Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Captcha
-
Labels:None
-
Tags:
Description
We have setSession() function where we can save the session into the $this->_session, but the generate() function simply overwrites what we kept here: $this->_session. There must be another way to handle this issue. If you protect the $this->_session, then don't provide public setSession().
/** * Zend_Captcha_Word */ public function setSession(Zend_Session_Namespace $session) { $this->_session = $session; return $this; } public function generate() { //****// $this->_session = null; //****// $id = $this->_generateRandomId(); $this->_setId($id); $word = $this->_generateWord(); $this->_setWord($word); return $id; }
I ran into this bug today and it took me 3 hours of thinking I was doing it wrong before I located the problem in zend. I fixed it by commenting out $this->_session = null;