note 38963 added to function.session-start

From: Date: Tue, 13 Jan 2004 14:05:46 +0000
Subject: note 38963 added to function.session-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-63408@lists.php.net to get a copy of this message
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! ---- Manual Page -- http://www.php.net/manual/en/function.session-start.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38963 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38963&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38963&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63408) next »