But it's best not to write Response.Cookies ("CookieName") casually. Expires=date, so that the call value between pages is empty.
Response.Cookies ("user_name"). Expires=date+1 ' Specify cookie save time
Keep cookies for one hours
Response.Cookies ("MyCookie"). Expires= (now () +1/24)
Response.Cookies ("MyCookie"). Expires = DATEADD ("h", 1, Now ())
Response.Cookies ("CookieName"). Expires=dateadd ("M", 60,now ())
Set expires after 60 months
Response.Cookies ("User"). Expires=second () +7
The time defined after expires can be replaced with a time function
For example: Date () +7 means adding 7 days to today's time, and second () +7 is 7 seconds.
Response.Cookies ("field name"). expires= time function +n, for example:
Response.Cookies ("Name2"). Expires=date+1, which means that Cookies are kept for 1 days, and then for example:
Response.Cookies ("Name2"). Expires=hour+8, which means Cookies are kept for 8 hours.
I have not tested this method (in 2003server,iis6.0), regardless of the second after the addition (), access to a 500 error (or the page can not be displayed?) Forgotten).
Dream-weaving Juve: Here's the time to add the suggestion or use the DateAdd function, such as we want to add an hour, then use:
Response.Cookies ("Baidooglecom"). Expires = DATEADD ("h", 1, Now ())
30 minutes:
Response.Cookies ("CookieName"). Expires=dateadd ("n", 30,now ())
DATEADD ("S", 30,now ()) Get seconds
EXPIRES Specifies the expiration date for the cookie. In order to store cookies on the client disk after the session is over, or at many times, we want to save cookies on the visitor's computer for a long time. The date must be set.
If the setting for this property does not exceed the current date, the cookie expires after the task ends.
The use of the cookie expires with "January 1, 2010": Response.Cookies ("CookieName"). expires= #January 01, 2010#
The expiration time for the cookie is "cookie creation time + 365 days": Response.Cookies ("CookieName"). Expires=date+365 recommended.
But it's best not to write Response.Cookies ("CookieName") casually. Expires=date, so that the call value between pages is empty.