There are two types of cookies in ASP.NET
Permanent cookies:
Cookies are stored on your computerβs hard drive. They remain on your hard drive and can be accessed by web servers until they are deleted or expired.
public void SetPersistentCookies(string name, string value) { HttpCookie cookie = new HttpCookie(name); cookie.Value = value; cookie.Expires = Convert.ToDateTime("12/12/2008β³); Response.Cookies.Add(cookie); }
Continuous Cookies:
Cookies are only saved while your web browser is running. They can only be used by the web server until the browser closes. They are not saved on your disk.
public void SetNonPersistentCookies(string name, string value) { HttpCookie cookie = new HttpCookie(name); cookie.Value = value; Response.Cookies.Add(cookie); }
Deepak.Aggrawal Aug 02 2018-11-11T00: 00Z
source share