Thursday, 13 August 2009

Sharepoint Setting Cookies

To Set Cookies you must do the following:

 

cookie = new HttpCookie(“MyCookie”);

cookie.Values["textSize"] = value;

cookie.Expires = DateTime.Now.AddDays(30);

 

HttpContext.Current.Response.Cookies.Add(cookie);

 

It’s the HttpContext bit which makes it persist!

 

No comments:

Post a Comment