Re: session cookies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux