in reply to Re: Loging a user out with CGI and Cookies?
in thread Loging a user out with CGI and Cookies?
First, the browser can indeed handle the cookie header and the "Location: ..." header line in the same server response. The Location line must come last and it must end with two new-lines.
But I can find no indication in my quick re-visiting of the docs that the CGI redirect function allows the specification of a cookie along with the redirect. (Update: but see the following response by athomason.) And the CGI pod says don't print a header along with a redirect.
So I accomplish this manually:
There may be a gotcha here but I haven't run into it.print "Set-Cookie: $usr=x;expires=-1d\n"; print "Location: http://mypage.com/my_login.html\n\n";
BTW, are you sure that $in{usr} and $usr have the same value? That would, of course, be crucial to what you are trying to do.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Loging a user out with CGI and Cookies?
by athomason (Curate) on Apr 16, 2001 at 05:53 UTC |