Re: cookie problem. Not possible to set and read a cookie on the same page?

From: Date: Tue, 26 Mar 2002 16:48:07 +0000
Subject: Re: cookie problem. Not possible to set and read a cookie on the same page?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-90220@lists.php.net to get a copy of this message
On Tuesday, March 26, 2002, at 11:42 AM, Miguel Cruz wrote:
There is no chance for the server to re-read the cookies from the browser after step 2 above, unless, as you've observed, you refresh the page, which in effect just repeats both steps.
One ugly way that I've gotten around this in one of my scripts was to set the cookie, and then use header(location: samepage.php) to refresh the page -- worked fine, and if all you do is set the cookie before calling header() it should be practically unnoticeable. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#90220) next »