Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
how to increase session timeout in asp.net
Posted 20-Feb-13 20:51pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

By default, Session timeouts are set to expire in ASP.NET in 20 minutes. To increase the timeout or expiry you should change the timeout attribute for SessionState in the web.config file
<sessionState  timeout="40" />
Note that if you are using Forms authentication, the Forms timeout setting will log the user out after the set timeout period so you will also have to adjust this attribute:
<authentication mode="Forms">
   <forms timeout="40"/>
</authentication>
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

see the solved one in following link
 
session timeout in asp.net[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 7

You can change in webb.config file here is the example
 
<?xml version="1.0"?>
 
<configuration>
<system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"  />
    <sessionState timeout="20000"></sessionState>
  </system.web>
<pre></configuration>
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 8

<configuration>
<system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <httpRuntime targetFramework="4.0"  />
    <sessionState timeout="20000"></sessionState>
</system.web>
</configuration>
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 9

Put this code on Page_Load,
Session.Timeout = 60   // 60 minutes; MAX is 1440 (if I'm not mistaken)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Add This code inside in web.config file
 
 <sessionState mode="InProc" cookieless="false" timeout="2000"/>
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

hai
try to use following JavaScript code in master page
  <script type="text/javascript">
                var logoutUser = false;
                var timeoutHnd = null;
                var logouTimeInterval = 15 * 60 * 1000; // 15 mins here u can increase session time
                function onuser_activite() {
                    if (logoutUser) {
                        ;
                    }
                    else {
                        ResetLogOutTimer();
 
                    }
                }
                function OnTimeoutReached() {
                    logoutUser = true;
                    alert("You have been automatically Log Off from the system !");
                    window.location.href = "Logout.aspx";
 
                }
                function ResetLogOutTimer() {
                    clearTimeout(timeoutHnd);
                    // set new timer
                    timeoutHnd = setTimeout('OnTimeoutReached();', logouTimeInterval);
                }
 

                document.body.onclick = onuser_activite;
                timeoutHnd = setTimeout('OnTimeoutReached();', logouTimeInterval);
            </script>
 
var logouTimeInterval = 15 * 60 * 1000; in this line session time is passed as 15 mins
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 10

You can do that in different ways. I have provided 2 ways here.
In web.config
<sessionState timeout = "XX" mode = "InProc">
Default value must be there as 20
 
Else you can do that from IIS level
On IIS select the website you want to change the default session time out. Click on "Session State". provide the Time-out(in minutes):
  Permalink  

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



Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 15 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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