views:

19

answers:

0

Cookie is not working with IE. The browser is set to allow cookies. Works fine in Firefox... and works fine in IE when I run it locally. But as soon as I publish, it breaks. It is used for a poll so a user cannot vote more than once. The following code runs once a user tries to vote:

if (Request.Cookies["Poll"] != null && Request.Cookies["Poll"].Value == "Voted")
{
    // Display label
    lblVoted.Visible= true;
}
else
{
    // Update DB
    // Add cookie
    Response.Cookies["Poll"].Value = "Voted";
    Response.Cookies["Poll"].Expires = DateTime.Now.AddDays(30);
}