ASP.NET authentication cookie disappears, only in IE, only from certain places

Internet Explorer does not support my cookie authentication after redirecting one page.

Here is the situation:

I have an ASP.NET 2.0 web application running on an iis7 shared host. The application uses forms authentication to process the username and username and cookie (.ASPXFORMSAUTH) on the client machine for this purpose.

in IE (verified with version 8, 9), from some places , the authentication cookie is not saved after the first page. Observed Behavior:

  • Username and password are sent in the login form.
  • The user is successfully redirected to the page with the first after login (and the violinist shows that the cookie exists.ASPXFORMSAUTH)
  • After clicking on another link or pressing F5 to update, the user is redirected to the login, and the authentication cookie (depending on the script) no longer exists. upon update / click in the request headers there is no authentication cookie.

This does not happen in Chrome / FF and even in IE it seems to depend on the location from which I am connected.

also, locally (using the internal dev server in VS2008), everything works fine and is well reflected in the violin.

I knock on him for several days. I thought it might be some kind of strange firewall problem, but it couldn’t determine anything convincing.

Ideas will be appreciated.

+5
source share
4

IE - , - , IE cookie... , , .

, -- , test_domain . , - , IP. , , , http://localhost, . IE , .

, , . . IE .

+9

:

, .

, : , , :

protected void LoginStatusLink_LoggedOut(object sender, EventArgs e) {
    // remove the authenticatation cookies from the browser
    FormsAuthentication.SignOut();

    // force a new 'expired' auth cookie
    HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName);
    cookie.Expires = DateTime.Now.AddMonths(-1);
    Response.Cookies.Add(cookie);

    // delete roles cookie
    Roles.DeleteCookie();

    // clear and abandon session
    Session.Clear();
    Session.Abandon();

    // this line just to leave (forget) the current page
    this.Response.Redirect("~/");
}
+1

1. cookie

2. cookie IE

0

Check the server date. I had a situation where the server was 1 day behind the browser, so the cookie for verification has expired significantly. This affected IE, but not FF.

0
source

All Articles