Wednesday, October 3, 2007

How to create a permanent cookie

The permanent cookie is created the same way the normal cookie is created. To create a permanent cookie you have to specify a date in the future. Like,oHeader.AddCookie('userid',lcID,'/wconnect','NEVER') where NEVER is converted to a date in future.

HttpCookie l_objCookie = new HttpCookie("myCokie", "myValue");
l_objCookie.Expires = DateTime.MaxValue;
Response.Cookies.Add(l_objCookie);

No comments: