Sorry for the spamming, ive narrowed it down to a problem in
Zend_Session::start(); , if i call Zend_Session::setOptions then the
raw session_start() method after running a session_destroy on the non
cookie session its fine I get an id wherevers start() is still trying to
use the non cookie session and not use the cookie one. in start() SID
is still the non cookie session so it thinks its still this and that the
session is open even though the session is destroyed ?
if (self::$_sessionStarted) {
return; // already started
}
Thinks its still started so doesnt run start, getId never returns an id.
Again if I just run session_start() directly it comes up fine, i get
output from getId.
Dan Rossi wrote:
Alright its still not working, this brings up an empty session. I did
find, on the index controller if rememberme is set the session id is
regenerated on each page refresh, before and after start is called. I
basically need the temporary url session completely destroyed so its
not callable / reusable, as i find them still on the filesystem. I
then need the more permanent one setup which will not store the
variables, a var_dump on the session shows its storing something into
$_SESSION.
Here is the xml config for it
<cache_expire>172800</cache_expire>
<cache_limiter>nocache</cache_limiter>
<gc_maxlifetime>172800</gc_maxlifetime>
<save_path>/tmp/path</save_path>
<use_cookies>1</use_cookies>
<remember_me_seconds>172800</remember_me_seconds>
if ($auth->getStorage()->read()->access_code)
{
$access_code = $auth->getStorage()->read()->access_code;
$auth->clearIdentity();
Zend_Session::destroy(true,false);
// session_destroy();
// Zend_Session::start();
Zend_Session::setOptions($config->session->toArray());
// Zend_Session::regenerateId();
//Zend_Session::start();
// Zend_Session::rememberMe(172800);
$this->session = new Zend_Session_Namespace('NameSpace');
//$this->session->unLock();
$this->session->access_code = '23598532908325';
// echo Zend_Session::getId();
// var_dump($_SESSION);
//echo Zend_Session::getId();
$this->_redirector->gotoUrl('/');
return;
//Zend_Session::regenerateId();
}
Dan Rossi wrote:
Darby I took out the call to start and rememberme and no luck. Even
trying to destroy first before hand wont work !
Darby Felton wrote:
Hi Dan,
Once thing I notice is that the rememberMe() call comes after starting
the session. Instead, rememberMe() can only have an effect /before/ the
session is started, since it uses session_set_cookie_params().
Maybe try taking out the call to Zend_Session::start(), since the
session is automatically started when instantiating
Zend_Session_Namespace.
Best regards,
Darby
Dan Rossi wrote:
Hi here is the session issue again it wont store the session variable
when going to a new page. Im using a custom Zend_Auth adapter which
firstly authenticates a client anonymouslly with some details in a
customer database via a soap service. It returns the non cookie
session
id. It returns to another system like
/check/index/client/03523252380952380935.
It gets past the first session, loads the persistent temporary login
from the url session. I then want to clear that authentication and
then
attermpt to setup either a more permanent session or permanent login
using the auth adapter again somehow. The problem is as before, any
vairable i try to set to the new namespace is not stored at all,
even in
the session file.
Code inside the check controller is
Zend_Session::setOptions($config->keySession->toArray());
Zend_Session::setId($this->getRequest()->getParam('client'));
Zend_Session::start();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity())
{
if ($auth->getStorage()->read()->access_code)
{
$access_code =
$auth->getStorage()->read()->access_code;
$auth->clearIdentity();
Zend_Session::setOptions($config->session->toArray());
Zend_Session::regenerateId();
Zend_Session::start();
Zend_Session::rememberMe(172800);
$this->session = new Zend_Session_Namespace('Custom');
$this->session->access_code = $access_code;
$this->_redirector->gotoUrl('/');
return;
}
}