I am very new to this Zend_Session thing. I do have a Zend Framework App running; now I want to add some "features" to it. One of that features requires some data contained in a Session, so it is stored over all sites, the user will visit.
In my Bootstrap, I have
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initSession() {
Zend_Session::setOptions(array(
'use_only_cookies' => 'on',
'remember_me_seconds' => 864000
));
Zend_Session::start();
}
}
In my model, there is a function that stores data into the $_SESSION for a given keyword:
$_SESSION['foo'][urlencode($keyword)] = array(
'data' => $base->some->foo[0]->fish->data
);
The new data is only set to session, if the session-key (with the keyword) is not set. I checked that with zend debugger, all is running well.
Now, when I call the page first, all's running well. When I reload the page (or move to another), the values in the Session are gone. So, to be exact, the keys are there, the $_SESSION Array is (for example) 20 entries of size. There is an entry, but it is null.
$_SESSION['foo']['my+foo']['data'] = null
When I call:
Zend_Debug::dump($_SESSION['foo']['my+foo']);
I get:
array (size=1)
'data' => null
So, it is there and it had killed my value.
What is the magic voodoo to get it running like when I use a simple session_start()?