Cookie does not work in IE

Cookies do not work with IE. The browser allows the use of cookies. It 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 polling, so the user cannot vote more than once. The following code runs as soon as the 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);
}
+3
source share
2 answers

You may have an underscore in the name of your local server. This can sometimes be a problem. Check out http://www.enhanceie.com/ie/bugs.asp

+2
source

cookie cookie (, ), cookie, , P3P). "" > " -", , cookie.

+1

Source: https://habr.com/ru/post/1752336/