RE: [PHP] Getting Cookie after Rederection...

From: Date: Tue, 01 Aug 2000 12:46:43 +0000
Subject: RE: [PHP] Getting Cookie after Rederection...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-9424@lists.php.net to get a copy of this message
I've been setting cookies and redirecting using Header() from the same page, is what you mean? M@ > -----Original Message----- > From: Sylwester Zarębski [mailto:sylwek@isp.net.pl] > Sent: Tuesday, August 01, 2000 01:33 > To: PHP general list > Subject: Re: [PHP] Getting Cookie after Rederection... > > > Teodor Cimpoesu wrote: > > > > On Tue, 01 Aug 2000, Martin Thoma wrote: > > > > > I set a cookie with "setCookie". In the same script, I use > > > Header("Location:anotherfile.php") to redirect the script. > > > > > > In "anotherfile.php" I want to get the cookie set bevore. But the > > > Variable $HTTP_COOKIE_VARS is empty ! It doens't even appear on > > > phpinfo(); > > I noticed the same behaviour with Netscape on Linux. I dunno if it's > > NS related, or that the server sees it is a redirection to itself and > > resolve it w/o informing the browser. > > > > My trick is: > > 1. setCookie and also put it by myself in $HTTP_COOKIE_VARS > > 2. `include' the target files, which will find the info where > > it was supposed to be. > > As someone post about two weeks ago, you can't send > cookies header's and relocation headers in same time. > You must use another method (search list archives) > to redirect browser. Explanation of this is, browser > doesn't look at cookies headers if it find a location > header. > > -- > pozdrawiam.. > > ## ## | Sylwester Zarębski - ISP Group | > #### ## | e-mail: sylwek@isp.net.pl | > ## ## ## | ICQ uin: #45780888 | > ## #### ## | Administrator ISP.NET.PL | > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#9424) next »