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.
In reply to Re: Re: Loging a user out with CGI and Cookies?
by dvergin
in thread Loging a user out with CGI and Cookies?
by r.joseph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |