1

I'm working on a web project that contains sessions. I have a few pages on the web app: Logon.aspx - If the verification of user is OK, a new session is created:

Pseudo:

    If User.connected = True Then
        Session("isLogin") = True
        Response.Redirect("Content.aspx")
    End If

In the “Content.aspx” in the Page_Init event:

    If Session("isLogin") = False Then
        Response.Redirect("Logon.aspx")
    End If

Web.config settings:

<forms loginUrl="~/Logon.aspx" timeout="50" />
<sessionState mode="InProc" timeout="60">

When I run it locally (IIS Express), all works as expected.
However, when I run it on the IIS server, after a few minutes the session resets and throws me to Logon.aspx.

IIS Server information:

I am using IIS 8.5

Idle Time-out (minutes): 60

Regular Time Interval (minutes): 1740



How can I fix this session reset?

P.S. I have read all your suggestions (until Mar 14 '15).
Also, read all suggestions at session-timeout-in-asp-net), but could not find a solution.

Community
  • 1
  • 1
DUKEiLL
  • 199
  • 2
  • 6
  • 17
  • 1
    Don't use in-process session unless for testing purposes. IIS worker process can be shut down or recycled, which simply drops all sessions. If you don't plan to learn IIS, you should. – Lex Li Mar 01 '15 at 11:59
  • possible duplicate of [Session timeout in ASP.NET](http://stackoverflow.com/questions/648992/session-timeout-in-asp-net) – Lex Li Mar 01 '15 at 12:00

1 Answers1

2

I have previously used Application Pool with the settings: .NET v4.5

When I change Application Pool’s settings to .NET v4.5 Classic, the problem stopped!

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
DUKEiLL
  • 199
  • 2
  • 6
  • 17