Re: Getting Cookie after Rederection...

From: Date: Tue, 01 Aug 2000 12:33:09 +0000
Subject: Re: Getting Cookie after Rederection...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-9423@lists.php.net to get a copy of this message
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 |

« previous php.general (#9423) next »