I'm using the following code to write a cookie...
...and then as part of a subsequent page load I'm using this code to retrieve the cookie and check it...
This works fine in Firefox but using the same application in IE always fails to retrieve the Cookie (objCookie is null). Is there something I'm not doing, or is this just another part of Internet Explorer's personal vendetta against me?
Code:
HttpCookie objCookie = new HttpCookie("TCS_DATA_REQUEST");
objCookie.Expires = DateTime.Now.AddYears(1);
objCookie.Values.Add("TCS_DATA_PROVIDED", "yes");
Response.Cookies.Add(objCookie);
...and then as part of a subsequent page load I'm using this code to retrieve the cookie and check it...
Code:
HttpCookie objCookie = Request.Cookies["TCS_DATA_REQUEST"];
if (objCookie != null ? objCookie.Values["TCS_DATA_PROVIDED"] == "yes" : false)
{
// Never gets here if using IE
}
This works fine in Firefox but using the same application in IE always fails to retrieve the Cookie (objCookie is null). Is there something I'm not doing, or is this just another part of Internet Explorer's personal vendetta against me?