Recommended: Asp tutorial on how to display data code horizontally % sql=select*fromserrwhereorderbyidasc setrs=server.createobject(adodb.recordset) rs.opensql,conn,1,1 %styletype=text/css !-- body,td,th{ font-size:12px; } -- /style tablewidth=100%align='center' % fori=1tors.recordCount' variable i
Response.Cookies(user_name).Expires=Date+1 'Specify the cookie saving time
Keep COOKIES for 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 to expire after 60 months
Response.Cookies(User).expires=second()+7
Time defined after expires can be replaced by 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, for example:
Response.Cookies(name2).expires=date+1 means that cookies are stored for 1 day, for example:
Response.Cookies(name2).expires=Hour+8, which means that cookies are stored for 8 hours.
I have tested this method but not (in 2003server, iis6.0). Regardless of whether there is a () addition after second, there will be a 500 error when accessing (or can't display the web page? Forgot).
Dreamweaver Juventus: It is recommended to use the DateAdd function for the time accumulation here. For example, if we want to accumulate one hour, use:
Response.Cookies(baidooglecom).expires=DateAdd(h,1,Now())
30 minutes:
Response.Cookies(CookieName).Expires=DateAdd(n,30,now())
dateadd(S,30,now()) gets seconds
Expires specifies the expiration date of the cookie. In order to store cookies on client disk after the session ends, or in many cases, we want to save cookies on the visitor's computer for longer. This date must be set.
If the setting of this property does not exceed the current date, the cookie will expire after the task is over.
The expiration date of the use of cookies is January 1, 2010: Response.Cookies(CookieName).Expires=#January01,2010#
The expiration time of the cookie is the creation time of the cookie + 365 days: Response.Cookies(CookieName).Expires=Date+365 recommended
But it is best not to write Response.Cookies(CookieName).Expires=Date casually, so that the value will be empty when calling between pages.
Share: A brief analysis of the asp program to create access database The access database belongs to a "file database". When creating, you need to specify the file it wants to use, as shown below: SetCatalog_object=Server.CreateObject(ADOX.Catalog) Catalog_object.Create(Provider=Microsoft.Jet.OLEDB.4.0;DataSource=Server.MapPath(/Database.mdb)) Two simple sentences