Suppress SID constant notices in older PHP versions.
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 18 Sep 2006 11:30:00 +0000 (11:30 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 18 Sep 2006 11:30:00 +0000 (11:30 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11710 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/global.php
src/login.php
src/redirect.php

index d7612d1613efe2b9bae8018a6972124868ee93ab..abb28b06233ff1d796bee283b31aa98dfd319051 100644 (file)
@@ -218,6 +218,13 @@ function sqgetGlobalVar($name, &$value, $search = SQ_INORDER, $default = NULL, $
 /**
  * Deletes an existing session, more advanced than the standard PHP
  * session_destroy(), it explicitly deletes the cookies and global vars.
+ *
+ * WARNING: Older PHP versions have some issues with session management.
+ * See http://bugs.php.net/11643 (warning, spammed bug tracker) and 
+ * http://bugs.php.net/13834. SID constant is not destroyed in PHP 4.1.2,
+ * 4.2.3 and maybe other versions. If you restart session after session 
+ * is destroyed, affected PHP versions produce PHP notice. Bug should 
+ * be fixed only in 4.3.0
  */
 function sqsession_destroy() {
 
index 4cb1f31e37ede846876f5e0caa9abda72a28d51f..1a3486172fc1303bb5516196f63ee37fd5b3f7b3 100644 (file)
@@ -35,19 +35,12 @@ set_up_language($squirrelmail_language, TRUE, TRUE);
  * In case the last session was not terminated properly, make sure
  * we get a new one, but make sure we preserve session_expired_*
  */
-/**
- * PHP bug. http://bugs.php.net/11643 (warning, spammed bug tracker) and
- * http://bugs.php.net/13834
- * SID constant is not destroyed in PHP 4.1.2, 4.2.3 and maybe other
- * versions. Produces warning on login page. Bug should be fixed only in 4.3.0
- */
 if ( !empty($_SESSION['session_expired_post']) && !empty($_SESSION['session_expired_location']) ) {
     $sep = $_SESSION['session_expired_post'];
     $sel = $_SESSION['session_expired_location'];
 
     sqsession_destroy();
-  
-    sqsession_is_active();
+    @sqsession_is_active();
     $_SESSION=array();
     sqsession_register($sep, 'session_expired_post');
     sqsession_register($sel, 'session_expired_location');
index ce067196dd2dea479257b3752210cf75b3460799..de4b5f875278a58ff1bcefbfde1c0b242972e0ff 100644 (file)
@@ -70,7 +70,7 @@ if (!sqsession_is_registered('user_is_logged_in')) {
 
     /* regenerate the session id to avoid session hyijacking */
     sqsession_destroy();
-    sqsession_is_active();
+    @sqsession_is_active();
     session_regenerate_id();
     /**
      * The cookie part. session_start and session_regenerate_session normally set