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">

 

 

You are viewing reply posted by: micah on Mar 13, 2017 12:59 AM.
Posted on Mar 13, 2017 12:59 AM

i need to persist the session not to expire, the reason is because my javascript codes throws errors when it session expires, secondly if the page keep expireing like that many users will be struggling to remember their login details.