2

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?

s.k.paul
  • 7,099
  • 28
  • 93
  • 168

2 Answers2

1

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

Nayan Hodar
  • 508
  • 7
  • 12
0

see

http://www.codeproject.com/Articles/113287/Why-Session-Timeout-is-not-working-for-your-websit

in resume: you have to configured it at IIS Application level

Juan Rada
  • 3,513
  • 1
  • 26
  • 26