开发者

Cookies in ASP.NET MVC 2

If you don't set an expiration date on cookies开发者_Go百科, do they draw the expiration date from the browser settings (if there are any), or do they have a default expiration or something?


If you don't set an expiration date on cookies, do they draw the expiration date from the browser settings (if there are any)

No, if you don't set an expires header for a cookie the cookie is temporary. There are 2 types of cookies: persistent and temporary. Persistent cookies (one for which you specify the expires header) are saved as temp files on the client computer and survive browser restarts (for the duration of the expiration period or if the user clears them).

Temporary cookies on the other hand live only inside the memory of the current instance of the browser. Just as persistent cookies they are sent along each request (without expiration) but once the user closes the browser they are gone forever.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜