I save the cookie in the sharepoint web part this way:
System.Web.HttpCookie cookie = new System.Web.HttpCookie(_cookieApplicationId); cookie[_cookieName] = value; cookie.Expires = DateTime.Now.AddMonths(1); HttpContext.Current.Response.SetCookie(cookie);
This cookie is always saved successfully. I see this on the client using firebug. When I try to read this cookie:
System.Web.HttpCookie cookie = HttpContext.Current.Request.Cookies[_cookieApplicationId]; return cookie[_cookieName];
It works when logging in, but this is not the case if I have not logged in.
Saving always works whether I am logged in or not. So where is the mistake?
Ole albers
source share