Re: cookies and redirection
| From: | Chris Boget | Date: | Wed, 13 Aug 2003 20:25:14 +0000 |
| Subject: | Re: cookies and redirection | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159486@lists.php.net to get a copy of this message | ||
> --- Joaco <joaco182@hotmail.com> wrote:
> > I set a cookie in my code and then redirect the user using a
> > header function. When I do this, my cookie is not created. If i
> > remove the header function, then it is. Is there a way around
> > this?
> If you are using IIS, read this:
>
> http://marc.theaimsgroup.com/?l=php-general&m=102929828515647&w=2
> If you are not, please post your code, because it should work fine.
You can't use any functions that send headers to the browser (and
that includes setcookie()) before you use:
header( 'location: http://blah' );
The browser will choke.
Chris