RE: [PHP] passing sessions with header()
| From: | John | Date: | Tue, 19 Jun 2007 20:58:13 +0000 |
| Subject: | RE: [PHP] passing sessions with header() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257459@lists.php.net to get a copy of this message | ||
> Just stick it on the end of the URL...
I'd like to keep it out of the URL if possible...
J
> -----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/