Re: passing sessions with header()
| From: | Stut | Date: | Tue, 19 Jun 2007 20:15:58 +0000 |
| Subject: | Re: passing sessions with header() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257462@lists.php.net to get a copy of this message | ||
John wrote:
In that case you don't have a problem. If the session ID is being passed in a cookie then it will survive redirects. -Stut -- http://stut.net/ >> -----Original Message----- >> From: Stut [mailto:stuttle@gmail.com] >> Sent: Tuesday, June 19, 2007 1:45 PM >> To: John >> Cc: php-general@lists.php.net >> Subject: Re: [PHP] passing sessions with header() >> >> John wrote: >>> The php.net manual states: >>> >>> <quote> >>> >>> Session ID is not passed with Location header even if >> session.use_trans_sid >>> is enabled. It must by passed manually using SID constant. >>> >>> </quote> >>> >>> How should the SID be passed manually? I'd like to keep the SID out of >> the >>> uri, so is a POST variable the best way to handle that? >>> >>> My problem is that I'm trying to keep a session persistent through a >>> header() redirect. which when left to it's own, looses all association >> to >>> the session . >> Just stick it on the end of the URL... >> >> header('Location: http://domain.com/dir/script.php?'.SID); >> >> Or, if you already have a querystring... >> >> header('Location: http://domain.com/dir/script.php?a=b&'.SID); >> >> -Stut >> >> -- >> http://stut.net/Just stick it on the end of the URL...I'd like to keep it out of the URL if possible...