Open driesdroesbeke opened 8 years ago
Is fixed by #660
It was not fixed, the PR was declined.
same problem
Is there any chance that someone will fix it before ZF1 EOL? I'm using lot of components from ZF1 and everything is fine under PHP7 except of Session.
I wrote some tests that worked in vagrant but failed on Travis.
I worked around the issue by changing the order of the session bootstrap. Make sure a session exists before regenerateId() is called.
My code
public function _initZendSession() {
$this->bootstrap('db');
$this->bootstrap('session');
Zend_Session::start();
$defaultNamespace = new Zend_Session_Namespace();
if (!isset($defaultNamespace->started)) {
Zend_Session::regenerateId();
$defaultNamespace->started = true;
}
}
And error is on line 320 of Zend\Session.php.
if (!self::$_unitTestEnabled) {
session_regenerate_id(true);
}
@driesdroesbeke the fix you suggested works by hiding the error message, but then the sid doesn't change when the user logs in (same cookie sid before and after they authenticate). Am I understanding this correctly?
I have the following code that works on php 5.6 but throws a warning on PHP7. The session is not stored in the db with Zend_Session_SaveHandler_DbTable.
The rememberMe method calls self::regenerateId() wich causes the following error on PHP7