There two type of cookies in ASP.NET
Persistent cookies: cookies are stored on your computer hard disk. They stay on your hard disk and can be accessed by web servers until they are deleted or have 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);}
Non-persistent cookies: cookies are saved only while your web browser is running. They can be used by a web server only until you close your browser. 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);}


Hi,
I am using froms authentication across application.When user wants to access Appln B , he is taken to login page of Appln A and then enters his credentials.Once he is authenticated i am storing some values in a Cookie and he is redirected to home page of Appln B.Then i need to access this cookie in Appln B.Also i need to set the expiration of cookie to session timeout.How do i do that ?
Thanx in Advance
Ravneet