Re: header lost session variables.

From: Date: Tue, 15 Aug 2006 00:03:38 +0000
Subject: Re: header lost session variables.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-240673@lists.php.net to get a copy of this message
On Mon, August 14, 2006 8:04 am, João Cândido de Souza Neto wrote: > Anyone here know why in some cases when i use (header("Location: > ???"); the > system lost the session variables? Yes. The browser gets headers such as this: Location: http://example.com Cookie: Example Value *SOME* browsers, as soon as they see that Location: line, will IMMEDIATELY go to the other URL, ignoring the Cookie line. Don't do that. If the Location: is your own PHP code, just include() it and do exit; and call it fixed. You can also try to throw a session_write_close (?) before the header("Location: ") line -- Others have posted some success with that, but I suspect it won't fix things for EVERY browser out there. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#240673) next »