Stop page from redirecting to Login page when page is idol for some time in ASP.Net

Last Reply on Mar 13, 2017 12:59 AM By micah

Posted on Mar 09, 2017 02:29 AM

My web page redirect users to login page when the page is idol for a while, i dont like such. I want the application to check if the user is authenticated if not redirect to login but yes let the user stay, i dont want the authenticated users to be redirected to login page if  the page is domant for a while. web.conf

<?xml version="1.0" encoding="utf-8"?>
<!--
  
  -->
<configuration>
  <connectionStrings>
   // connection here
  </connectionStrings>
  <system.web>
    <sessionState timeout = "30"/>
    <httpRuntime executionTimeout="240" maxRequestLength="265600" />
    <customErrors defaultRedirect="~/Account/LockScreen.aspx" mode="Off" />
    <authorization>
      <deny users="?" />
    </authorization>
    <authentication mode="Forms">
      <forms defaultUrl="Home.aspx" loginUrl="Default.aspx" slidingExpiration="false" />
    </authentication>
    <compilation debug="true" targetFramework="4.5">

 

 

Posted on Mar 09, 2017 05:22 AM Modified on on Mar 09, 2017 05:35 AM

Hi micah,

You need to extend your session time. Because your session is expiring therefore you are getting this problem.So please refer the below link.

Display Session Timeout message before Session expires in ASP.Net