hello everyone.
When user login successfully, I write login info to Session, as following code:
PHP Code:
$auth = Zend_Auth::getInstance();
$data = $authAdapter->getResultRowObject(null,'password');
$auth->getStorage()->write($data);
in another page, I read the values stored in the session as following code:
PHP Code:
$auth = Zend_Auth::getInstance();
$role = $this->_auth->getStorage()->read();
It works fine.
But when I call Zend_Session::setOptions to set options for Session, the value readed from Session is null. following is the code of setOptions :
PHP Code:
private function _buildSession()
{
$sessionConfig = $this->_config->system->session->toArray();
if (isset($sessionConfig ['save_path']))
{
$sessionConfig ['save_path'] = ROOT_DIR . $sessionConfig ['save_path'];
}
if (isset($sessionConfig ['cookie_path']))
{
$sessionConfig ['cookie_path'] = ROOT_DIR . $sessionConfig ['cookie_path'];
}
Zend_Session::setOptions($sessionConfig);
}
Could you please tell me what the problem is ?
thank you in advance.