2
votes

In my web.config file, the session state configuration is as follows-

<sessionState mode="InProc" timeout="540" />

In IIS 7, session time out value alse 540. But still, session expires very quickly (within 5-15 minutes).

It is an asp.net mvc 4 application. Except login.cshtml, all other .cshtml views are loaded via ajax calls as a partial view. i.e. main home page loads only once and all other subsequent pages are loaded within a div on main home page.

How to get rid of this problem?

2

2 Answers

1
votes

if you are want session timeout for website than remove

<authentication mode="Forms">
  <forms timeout="50"/>

tag from web.config file.

and add

<system.web>
<sessionState mode="InProc" timeout="60">
</sessionState>

in web.config file

and

 void Session_Start(object sender, EventArgs e)
    {
        Session.Timeout = 60;
    }

in Global.asax