Home > DeveloperSection > Forums > How to expire session after 10 minutes?
Ankita Pandey
Ankita Pandey

Total Post:183

Points:1285
Posted on    October-08-2014 12:44 AM

 ASP.Net ASP.Net  C# 
Ratings:


 1 Reply(s)
 811  View(s)
Rate this:

I have to expire a session after 30 minutes when user doesnt do any work for 30 minutes But when user does any work then session should not expire.

How can I do this?



Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    October-08-2014 12:47 AM

Set your Session.Timeout to be 30

Session.Timeout = 30;

You can do this on the session start event in the global.asax file, or in your web.config file

<configuration>

  <system.web>

    <sessionState timeout="20"></sessionState>

  </system.web>

</configuration>


Modified On Oct-08-2014 12:50:58 AM

Don't want to miss updates? Please click the below button!

Follow MindStick