I have a ASP.Net MVC5 application and it have running for several months. However, I have found some strange things today.
If I logged into this application and lay aside one page for an hour without any operation, and then I send an ajax request using JQuery to the server, on the server side, System.Web.HttpContext.Current.Request.IsAuthenticated
is false
.
However, if I send a "get" request not ajax request(e.g. just press F5 to refresh this page), the IsAuthenticated
is true
. I have check that the .AspNet.ApplicationCookie
cookie is sent to the server correctly.
Why is the Request.IsAuthenticated
false when receiving an ajax request?