#9914 [Ana->Csd]: session_id loss with redirection via header() method

From: Date: Fri, 02 Sep 2005 11:53:21 +0000
Subject: #9914 [Ana->Csd]: session_id loss with redirection via header() method
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969369825@lists.php.net to get a copy of this message
ID: 9914 Updated by: vrana@php.net Reported By: royerj at free dot fr -Status: Analyzed +Status: Closed Bug Type: Documentation problem Operating System: any PHP Version: Irrelevant New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "Session ID is not passed with Location header even if session.use_trans_sid is enabled. It must by passed manually using SID constant." Previous Comments: ------------------------------------------------------------------------ [2002-04-15 20:19:18] sniper@php.net oops..my example was buggy..it should be something like this: header("Location: $someurl".'?'.session_name().'='.session_id()); ------------------------------------------------------------------------ [2002-04-15 13:28:09] rsswartz at yahoo dot com I've tried the recommended solution==> header("Location:$url.'?$PHPSESSID'"); This fails for me. My example: $SID1=$SID // * up at the top Header ("Location:registration.php.'?$SID1'"); Notice the strange registration.php. in the middle. Well php doesn't like it either. Any other recommendations? ------------------------------------------------------------------------ [2001-03-22 07:14:07] sniper@php.net You're right, the session id is not added when doing redirects. You have to do it 'manually', with something like this: header("Location: $url.'?$PHPSESSID'"); Reclassified as documentation problem. Note: IIRC there's also feature/change request about this. --Jani ------------------------------------------------------------------------ [2001-03-22 05:53:27] royerj at free dot fr Althought the transient_id option is active, the session_id is lost after using the header() method in order to redirect to another script. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=9914&edit=1

« previous php.doc (#969369825) next »