![]() |
|
|
+ Search |
![]()
|
Jul 6th, 2004 03:56
Deepak Bansal, Rachit Bagda, unknown unknown, http://www.rachit.com http://www.rtnaustralia.com http://www.rtnasia.com
There's no way you can set a cookie to NEVER expire - but what you can
do is to set the expiry date to several years ahead like "July 4,
2010"
:
Response.Cookies("cookiename").Expires = "July 4, 2010"
If you're thinking "Hey, what if today's date IS July 3, 2021 - my
cookie would expire tomorrow !!!". For this case, you can also use
relative expiration dates by using the syntax Date + n where n is the
number of days before expiring :
Response.Cookies("cookiename").Expires = Date + 300
This will in effect extend the expiry date of the cookie to an
additional 200 days from the time it was accessed.
© 1999-2004 Synop Pty Ltd