note 38963 deleted from function.session-start by tomsommer

From: Date: Sat, 28 Aug 2004 22:59:02 +0000
Subject: note 38963 deleted from function.session-start by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-75513@lists.php.net to get a copy of this message
Note Submitter: paul at cantos ---- If you need to call session_start() twice - eg if you are manually destroying and recreating a session, it is essential to disable transient SIDs before the second call, and re-enable them afterwards. Otherwise the URL rewriter will get called twice and it is likely (in PHP 4.2.3, at any rate) to trash your HTML output when doing so. eg: session_start(); if ( some_expression_if_need_to_rebuild_session } { ini_set('session.use_trans_sid', 0); # ... do whatever you need to do to trash the old session # ... and set up the new one session_id($new_sessionid); session_start(); ini_set('session.use_trans_sid', 1); } presumably session_regenerate_id() doesn't have this limitation, but not everyone has upgraded to a PHP version that includes that function!

« previous php.notes (#75513) next »