Click here to Skip to main content
14,304,561 members
Rate this:
Please Sign up or sign in to vote.
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
Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

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[^]
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100