note 35332 added to function.session-regenerate-id

From: Date: Thu, 28 Aug 2003 00:26:07 +0000
Subject: note 35332 added to function.session-regenerate-id
Groups: php.notes 
Request: Send a blank email to php-notes+get-55194@lists.php.net to get a copy of this message
I had problems with a proxy changing a visitors session_id-cookie, so he'd get a LOT of errors when visiting my site. I handled the bogus session-id's like this. (Note: It only works in versions > 4.3.2.) <?php // Start a session and suppress error-messages. @session_start(); // Catch bogus session-id's. if (!preg_match("/^[0-9a-z]*$/i", session_id())) { // Output a warning about the messed up session-id. $error->handleError("WARN", "Your session id is messed up, you might not be able to use some features on this site."); // Generate a fresh session-id. session_regenerate_id(); } // Site contents. ?> Hope someone can use it. ---- Manual Page -- http://www.php.net/manual/en/function.session-regenerate-id.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35332 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35332&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35332&report=yes

« previous php.notes (#55194) next »