Avatar of ASPNet_Developer
ASPNet_Developer

asked on 

How to force user to re-login after my session variable expires in ASP.Net?

I am user FORMS AUTHENTICATION in my web application.
<system.web>
  <authentication mode="Forms">
    <forms loginUrl="Login.aspx"
           timeout="3000"
           protection="none"
           cookieless="false" />
  </authentication>
</system.web>


I have a session variable sessionID. When my session variable expires of is set to less than zero. I would like to force the user to re-login again. Right now even when after I set  timeout="3000". I still able to user some of the webpages. What did I miss? Can any please suggest what I should do.
Thanks.
ASP.NETVisual Basic.NETWCF

Avatar of undefined
Last Comment
dj_alik
Avatar of dj_alik
dj_alik

look here:
Asp.net: Implementing Auto-Logout functionality
http://stackoverflow.com/questions/709182/asp-net-implementing-auto-logout-functionality
Avatar of Rick
Rick

You need to check if the session variable is not nothing on page load.

if isnothing(SessionID) Then
  Response.Redirect("~/Login/Login.aspx")
end if
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of dj_alik
dj_alik

3000 minutes?
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo