I assume that you want to redirect them to a page asking them to login
again and that you're storing username, password and the session
status in session variables, so.....
login_page.asp
----------------------------------------------------------------------------
--
<form method="post" action="another_page.asp">
<input type="text" name="login_name"><br>
<input type="password" name="login_password"><br>
<input type="submit" value="Submit Info">
</form>
----------------------------------------------------------------------------
--
another_page.asp
----------------------------------------------------------------------------
--
<%
' Get the form data and store in a session variable
Session("login_name") = Request.Form("login_name")
Session("login_password") = Request.Form("login_password")
' Check to see if the input is correct
If Session("login_name") = "keith" and
Session("login_password") = "pass" then
Session("login_status") = "TRUE"
Response.Redirect "another_page_2.asp"
Else
Session("login_status") = ""
Response.Redirect "login_page.asp"
End If
%>
----------------------------------------------------------------------------
--
Every page that requires a user to be logged in should have the
following code.....
<%
If Session("login_status") <> "TRUE" Then
Response.Redirect "login_page.asp"
End If
%>
"Keith" <@.> wrote in message news:eU**************@TK2MSFTNGP10.phx.gbl...
I want to do this to check when the username session variable has expired,
and thus their login session has expired. Then I will redirect them to a
different page than if they simplu had not logged in.
"J. Baute" <WU**********@spammotel.com> wrote in message
news:40**********************@news.skynet.be...
I don't think this is possible using the Session object alone,
in both cases a new session will be created when your ASP page is called
that will be checking the session.
So you'll have an empty session every time.
I don't know why you'd want to check this, but if you give some more
details maybe there's a way to get what you want.
"Keith" <@.> wrote in message
news:ui**************@TK2MSFTNGP10.phx.gbl... Is there any way of detecting whether a session variable does not
exist because it expired or because it simply did not exist in the first place?
Thanks