Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am creating a website and i want to set session timeout.
But i don't have any idea to how to set session timeout, for example after certain time if user clicks any button or link it will go to login page automatically.
Help me.
Posted
Updated 6-Aug-19 20:09pm

Below is a sample config.web file used to configure the session state settings for an ASP.NET application:
configuration>
  <sessionstate
      mode="inproc"
      cookieless="false"
      timeout="20"
      sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
      server="127.0.0.1"
      port="42424"
  />
</configuration>
.

Hope this will give an idea to you.
 
Share this answer
 
Well, you have two things here:
1. Detecting session timeout
2. Once it's a session timeout, direct user to login page.

Have a look at these:
Link 1[^]
Link 2[^]
Link 3[^]
Link 4[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900