Response.Cookies ("user_name"). expires=date+1 ' Specify cookie save time
Keep cookies one hour
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, while second () +7 is 7 seconds.
Response.Cookies (field name). expires= Time function +n, such as:
Response.Cookies ("name2"). expires=date+ 1, which means that cookies are kept for 1 days, and then:
Response.Cookies ("name2"). Expires=hour+8, which means cookies are kept for 8 hours.
This method I have not tested (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 Juventus: Here's the time to add to 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 Specify The cookie expiration date. In order to store the cookie on the client disk after the session is over, or in many cases, we want to save the cookie for a longer time on the visitor's computer. The date must be set.
If the setting of this property does not exceed the current date, the cookie expires after the task ends.
The use of the cookie expires in January 1, 2010: response.cookies ("CookieName"). expires= #January 01, 2010#
The expiration Time for cookies is "creation time of Cookie + 365 days": Response.Cookies ("CookieName"). expires=date+365 recommended
But it is best not to write response.cookies ("CookieName") casually. Expires=date, so that the call value between pages is empty.