Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/zend-session/library/Zend/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public static function start($options = false)
// Generate a valid, temporary replacement
self::setId(md5(self::getId()));
// Force a regenerate after session is started
self::$_regenerateIdState = -1;
self::regenerateId();
}

if (self::$_sessionStarted && self::$_destroyed) {
Expand Down Expand Up @@ -459,7 +459,7 @@ public static function start($options = false)
}

// See http://www.php.net/manual/en/ref.session.php for explanation
if (!self::$_unitTestEnabled && defined('SID')) {
if (!self::$_unitTestEnabled && defined('SID') && SID !== '') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this condition is adding to the difficulty to properly unit-test

/** @see Zend_Session_Exception */
// require_once 'Zend/Session/Exception.php';
throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()');
Expand Down Expand Up @@ -662,7 +662,7 @@ public static function getId()
*/
public static function setId($id)
{
if (!self::$_unitTestEnabled && defined('SID')) {
if (!self::$_unitTestEnabled && defined('SID') && SID !== '') {
/** @see Zend_Session_Exception */
// require_once 'Zend/Session/Exception.php';
throw new Zend_Session_Exception('The session has already been started. The session id must be set first.');
Expand Down