PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #9914 session_id loss with redirection via header() method
Submitted:22 Mar 2001 5:53am UTC Modified: 2 Sep 2005 1:53pm UTC
From:royerj at free dot fr Assigned to:
Status:Closed Category:Documentation problem
Version:Irrelevant OS:any
View/Vote Developer Edit Submission

Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can not add a comment to this report as it is marked as closed. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Category:
Summary:
From: royerj at free dot fr
New email:
Version: OS:
New Comment:

[22 Mar 2001 5:53am UTC] 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.
[22 Mar 2001 7:14am UTC] 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
[15 Apr 2002 1:28pm UTC] 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?
[15 Apr 2002 8:19pm UTC] sniper@php.net
oops..my example was buggy..it should be something like this:

header("Location: $someurl".'?'.session_name().'='.session_id());

[2 Sep 2005 1:53pm UTC] vrana@php.net
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."

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC