Coder's Guild Mailing List

Re: Cookies

Posted by Frank Hale on 1999-10-23

> >         'OK, THIS IS THE WAY TO KILL A COOKIE
> AFTER
> > X TIME! :)
> >         Response.Cookies(cookie).Expires = Date +
> > 365
> >         'AND NORMALLY, IF YOU PUT A ZERO, THE
> COOKIE
> > SHOULD BE KILLED
> > AFTER CLOSING A SESSION
> 
> So the key is to make the expiration date zero? I
> will
> try this out.
> 

No didn't work.

Here is the code I use to set my cookie:

# I pass $exp a zero for the expiration date
sub setCookie {
    my($name, $val, $exp) = @_;
    
    print "Set-Cookie: ";
    print "$name=$val; expires=$exp\n";
};

If I say go to another site then come back my cookie
is still saved and the user is still logged in. How
can I make it expire after he leaves the page?


__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com