-2

In my project session was only available for 30 minutes (Which is by default).

BUT... I want to disable this kind of session timeout. Means I required unlimited time for session by which my website never get log-in process again.

Emanuele Greco
  • 12,551
  • 7
  • 51
  • 70
Rajan Vachhani
  • 420
  • 3
  • 8
  • 17
  • you cannot set session time out to unlimited.. – Nag Jun 14 '13 at 10:01
  • which version of asp.net frame work r u using. Framework 4 has 20 minutes default. http://stackoverflow.com/questions/12756910/session-time-out-in-asp-net-4-0-on-iis-7-5 – शेखर Jun 14 '13 at 10:06
  • 2
    @Shekhar I am using 4.0 framework. i tried also but it's again required log-in process in 2 or 3 hours. – Rajan Vachhani Jun 15 '13 at 12:47

3 Answers3

4

NEVER do this!

If user press X button on his browser his session (and all it's objects) will always be kept in server memory!

The solution is keeping ASP.NET Session alive using this simple javascript hack, not making extremely long sessions.

Javascript forces the page to post empty data to the server, it's a kind of ping.
Server doesn't post anything back but the session timeout is automatically resetted.
You can configure session time on 20 mins, and ping timer on 19 mins.

Community
  • 1
  • 1
Emanuele Greco
  • 12,551
  • 7
  • 51
  • 70
1

try that it increase timeout. if you want to store login info use cookies

<configuration>
  <system.web>
  <sessionState timeout="525600"></sessionState>
 </system.web>
</configuration> 
kostas ch.
  • 1,960
  • 1
  • 17
  • 30
1

try this maximum session timeout

<configuration>
  <system.web>
     <sessionState timeout="525600"></sessionState>
  </system.web>
</configuration>
sangram parmar
  • 8,462
  • 2
  • 23
  • 47