Return to Login Screen on Session Timeout 
Author Message
 Return to Login Screen on Session Timeout

I am developing an intranet application which needs a timeout feature. The
timeout is set using the Session object's Timeout property. What I need to
do is to detect the timeout being reached, and redirect the browser to the
login page. If I can do this, I then need to prevent anyone re-entering the
application by pressing the Back button in the browser.

Anyone know how to do this?

Thanks

Paul

Configuration:
Development Environment - VI 6
Target Browser - IE4
Server - IIS 4



Sat, 14 Jul 2001 03:00:00 GMT  
 Return to Login Screen on Session Timeout
If the session has timed out, then the session ID should be empty (""). You
can check at the top of each page for an empty session ID and redirect to
the login page if it is.  By definition, the user couldn't back up into the
seeion because it is timed out.  They would need to log back in and create a
new session...

HTH

Ray

Quote:

>I am developing an intranet application which needs a timeout feature. The
>timeout is set using the Session object's Timeout property. What I need to
>do is to detect the timeout being reached, and redirect the browser to the
>login page. If I can do this, I then need to prevent anyone re-entering the
>application by pressing the Back button in the browser.

>Anyone know how to do this?

>Thanks

>Paul

>Configuration:
>Development Environment - VI 6
>Target Browser - IE4
>Server - IIS 4



Sat, 14 Jul 2001 03:00:00 GMT  
 Return to Login Screen on Session Timeout
1. Response.expires = 0 forces reload of pages (so back button no longer
    gets cached pages)

2. Set a Session Variable in you login page, check the variable at the top
    of each page, if it is Empty then Session has timed out and redirect to
    the log in  page   ( if isEmpty(Session("SessionFlag")) )

John

Quote:

>I am developing an intranet application which needs a timeout feature. The
>timeout is set using the Session object's Timeout property. What I need to
>do is to detect the timeout being reached, and redirect the browser to the
>login page. If I can do this, I then need to prevent anyone re-entering the
>application by pressing the Back button in the browser.

>Anyone know how to do this?

>Thanks

>Paul

>Configuration:
>Development Environment - VI 6
>Target Browser - IE4
>Server - IIS 4



Sat, 14 Jul 2001 03:00:00 GMT  
 Return to Login Screen on Session Timeout
I reread your question and my answer and I'm not real sure I anwered your
question...sorry.  You want to force the user to the login page when the
session times out?  Maybe use a Session_OnEnd routine in your global.asa.
Session_OnEnd occurs when a session is abandoned or times out. You could
redirect from there I suppose but I have not tried it...

Hope that's better...Let me know.

Ray


Quote:
>If the session has timed out, then the session ID should be empty (""). You
>can check at the top of each page for an empty session ID and redirect to
>the login page if it is.  By definition, the user couldn't back up into the
>seeion because it is timed out.  They would need to log back in and create
a
>new session...

>HTH

>Ray


>>I am developing an intranet application which needs a timeout feature. The
>>timeout is set using the Session object's Timeout property. What I need to
>>do is to detect the timeout being reached, and redirect the browser to the
>>login page. If I can do this, I then need to prevent anyone re-entering
the
>>application by pressing the Back button in the browser.

>>Anyone know how to do this?

>>Thanks

>>Paul

>>Configuration:
>>Development Environment - VI 6
>>Target Browser - IE4
>>Server - IIS 4



Sat, 14 Jul 2001 03:00:00 GMT  
 Return to Login Screen on Session Timeout
Ray and John,

Thanks both for you replies. They helped a lot. I have not been able to
redirect to the login page automatically on Timeout. I tried a
Response.Redirect in Session_OnEnd, but the Response object is not
understood there. However, by checking a session variable on entry to every
page (and Setting Response.Expires to 0), if the connection is broken, the
user is redirected to a page where (s)he is notified of the break in
connection, and given a link back to the Logon page. When the user presses a
Logout button in the App, Reponse is redirected to the Logon Page. The
mechanism you suggested also prevents any funny stuff with the Back Button
in this scenario.

Thanks again

Paul



Sat, 14 Jul 2001 03:00:00 GMT  
 Return to Login Screen on Session Timeout
Hey Paul, the solution to your problem is very easy..

check this out...
at the top of each your pages, check to see if the session variable which
you are using for your flag has not timed out( usually if it has timmed out,
it's value is 0)

so you would use
<%if session("flag")="" then
...
'if the session variable is blank, then it most certainly got timmed out..%>
now hopefully your login screen is nothing really complicated but a user
name text box and a password text box in a form which submits to another asp
page or cgi script which evaluates and validates the values in these input
fields so this is what you would typically do in such a situation...

get the html and/or asp you need for your loggin script.. (which I will call
for sample purposes
[LOGIN_HTML_ASP])
get the normal html and/or asp for the page which is part of your site
[REGULAR_HTML_ASP]
get the asp script which validates all the user information and build a
structure similar to this..
[VALIDATE_ASP]
<!-- Sample Page-->

<html>
<% if session("flag")="" then
'session has timmed out or it's just the first time that the user is
visiting this page and you haven't yet assigned
'a session varaible to him/her so either way, you will have to make them
loggiin.. and not neccesarily by
'redirecting them to another page('that's why asp is so cool') but by just
showing them what they need to
'loggin..
%>

<!--[LOGIN_HTML_ASP] goes here with a hidden input which contains the value
of the location of this page
<input type='hidden'  id=location name=location>
<script language='javascript'>
function SubmitForm()
{
  // You might just have to submit your loggin form with scripting
technology and not with a simple submit button
// so that you can grab the value of the location of the file which the user
wished to browse when s/he timed out.

 document.all.location.value=location.href
 document.all.form.submit()

Quote:
}

</script>
-->

<%else
'if it;s not the case and that the user allready has a session variable,
then he/she is ok to continew browsing your page..
%>

<!--[REGULAR_HTML_ASP]-->

<%End if%>
%>
</html>

Now in your VALIDATE_ASP,
after you have processed all of the user's info and they have been
validated,
you would set the redirect of this page to
response.redirect (request.form("location"))
so that now they go back to where they were, with 1 new things, one is a
brand new session variable which will allow them to browse that page at
ease...
this way is probably the best way to do it rather than having to redirect
the user to some other page then the  user looses track of what page s/he
was on..

I know this sounds confusing, but  right now, I really didn't have the time
to put together a sample app.
if you would like to take a look at one of my sample source codes, e-mail me
and I will reply to you with the source code to do this..
I hope my brief description helped a little bit to put you on the right
track but as I said if it didn't, just e-mail me..


Later

Awah

Quote:

>I am developing an intranet application which needs a timeout feature. The
>timeout is set using the Session object's Timeout property. What I need to
>do is to detect the timeout being reached, and redirect the browser to the
>login page. If I can do this, I then need to prevent anyone re-entering the
>application by pressing the Back button in the browser.

>Anyone know how to do this?

>Thanks

>Paul

>Configuration:
>Development Environment - VI 6
>Target Browser - IE4
>Server - IIS 4



Sun, 15 Jul 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. session timeout in outlook2000

2. Change length of session timeout?

3. Session Timeouts

4. session timeout

5. How do I Set Login Timeout?

6. Session Timeout

7. Session Timeouts

8. ODBC Login Timeout

9. Session timeout/disconnect

10. Login script..timeout?

11. Login script..timeout?

12. session.timeout counter on asp pages ?

 

 
Powered by phpBB® Forum Software