Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.0 RC1
-
Fix Version/s: 1.0.4
-
Component/s: Zend_Session
-
Labels:
-
Fix Version Priority:Should Have
Description
The following doesn't work:
Zend_Session::start(); Zend_Session::destroy(); Zend_Session::start();
It never writes any session data, because the second start() command is silently ignored.
Here is a patch which fixes the problem:
Index: Session.php
===================================================================
--- Session.php (revision 5124)
+++ Session.php (working copy)
@@ -360,11 +360,6 @@
. " output started in {$filename}/{$linenum}");
}
- // See http://www.php.net/manual/en/ref.session.php for explanation
- if (defined('SID')) {
- throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()');
- }
-
/**
* Hack to throw exceptions on start instead of php errors
* @see http://framework.zend.com/issues/browse/ZF-1325
@@ -379,6 +374,7 @@
throw new Zend_Session_Exception(__CLASS__ . '::' . __FUNCTION__ . '() - ' . Zend_Session_Exception::$sessionStartError);
}
+ self::$_destroyed = false;
parent::$_readable = true;
parent::$_writable = true;
self::$_sessionStarted = true;
@@ -594,11 +590,15 @@
}
session_destroy();
+
self::$_destroyed = true;
-
+ self::$_sessionStarted = false;
+ self::$_regenerateIdState = -1;
+
if ($remove_cookie) {
self::expireSessionCookie();
}
}
Issue Links
| This issue is duplicated by: | ||||
| ZF-11420 | Zend_Session doesn't allow you to destory and recreate a session |
|
|
|
Assign to Darby.