August 06, 2009 by David
How to create a session control that automatically logs out the users when the session times out?
In ASP, even when the session has timed out, you will still stay on the same page unless you request a new page. This can be an issue if the user is on a public computer.
If we integrated the ASP session value directly into the javacript, the script would always think the session state is active since the ASP code will be built by the server before the javacript gets loaded.
Ajax solves this ASP problem by requesting a different page to check for the session state and give that result back to the javacript.
AJAX PAGE THAT CHECKS THE SESSION STATE
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% if len(session("OrgID")) > 0 then response.write "1" else response.write "0" end if %>
Leave a Comment