Re: session cookies

From: Date: Thu, 01 Sep 2005 20:56:43 +0000
Subject: Re: session cookies
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-221724@lists.php.net to get a copy of this message
Mikey wrote:
Jasper Bryant-Greene wrote:
Philip Hallstrom wrote:
Then use an HTML meta refresh (or javascript, just not Header("Location...) to redirect them to another page.
Why not header("Location...")? Just out of interest -- it's always worked for me, and it's a much better way to redirect users for many reasons[1] (like not breaking the back button). [1] http://www.w3.org/QA/Tips/reback
Because if you just re-direct to a new location then the cookie that you have also set in the headers will not reach the client.
That is not true. The output to the client will look like this: HTTP/1.1 302 Found Set-Cookie: name=value;domain=whatever Location: http://my.domain.com/my.php [...] Therefore the cookie does reach the client, and unless the client is buggy it will set the cookie. In my experience most modern browsers have no problem with this, but if someone else has more experience with this than me then please correct me. -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/

« previous php.general (#221724) next »