Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Notifying a user when the session timeouts
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00228729
Message ID:
00228856
Vues:
18
FYI, you can also use isObject(Session) to see if the Session Object still exists. Thanks for the info. I was afraid of that.

>>>>What is the best way to redirect a user to another page when their session timeouts?
>>>
>>>Why not use Response.Redirect if session variables are empty?
>>
>>Because I don't want to have to check session variables everytime a user clicks a button or link. I have been trying to use the Session_Onend event, but with no luck. It doesn't seem to do anything. Have you used this?
>
>Because ASP cannot respond to events, Session_OnEnd doesn't really help with this. Testing a Session variable is pretty much your only option. Since we store the ADO connection string to a Session variable, at the top of every page we test it's length using LEN(). If it evaluates to zero, we know the session has timed out and we redirect them to a page that tells them what happened. Our code looks like this:
>
><%
>If Len(Session("strConn")) = 0 Then
>Response.Redirect "timeout.asp"
>End If
>%>
>
>We keep the code in an include file and we've added the include reference into the default ASP page template so it's always there whenever we create a new ASP page.
Tim Westmoreland
Software Engineer
Skyline Technologies, Inc.

"Upper classes are a nation's past; the middle class is its future." - Ayn Rand, Russian-born author (1905-1982).
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform