Session cookies
================
Session cookies are temporary cookie files that will expire and be deleted after you close your browser.
When you restart your browser and return to the site that previously created the cookie for you, this site will not know you. you must log on again. after logon, a new session cookie is generated. your browsing information will be stored in the new cookie, which will remain active until you close the browser again.
Session cookies can only be used by browsers. Other applicationsProgramCannot be shared.
Persistent cookies
================
Persistent cookies are stored in a sub-folder of a browser. They exist until they are deleted manually or regularly cleared by the browser.
Persistent cookies can be shared among multiple applications, provided that these applications can access the same cookie store. By default, the expiration time of the persistent cookie is 30 minutes.
If you want to extend the time, you need to add the following line to the website's web. config.
<Forms loginurl = "login. aspx" name = ". aspxformsauth" timeout = "100"/>
What does it depend on to enable the persistent cookie? The answer is the implementation of the site's authentication provider.CodeThe snippets are as follows.
Formsauthenticationticket ticket = newFormsauthenticationticket(1, "username", datetime. Now, datetime. Now. addminutes (30), // value of time out property false ,//Value of ispersistent PropertyString. Empty, formsauthentication. formscookiepath );
References:
================
Are all cookies the same?
Http://www.allaboutcookies.org/cookies/cookies-the-same.html
Plan Authentication Settings for Web applications (Windows SharePoint Services)
Http://technet.microsoft.com/en-us/library/cc288081 (office.12). aspx
Explained: Forms authentication in ASP. NET 2.0
http://msdn.microsoft.com/en-us/library/ff647070.aspx