Click to See Complete Forum and Search --> : Session.timeout
janlee
05-01-2005, 06:59 AM
Hi,
I would like use the 'session timeout' to restrict the maximum amount of time maximum amount of time for a USER to use the resssources of my website. For example, after LOGIN he/see would have 5 minutos to execute de ressources of the website?
Thank you in advance
JanLee :D
buntine
05-01-2005, 07:29 AM
You can use the collowing command to programmatically set the session timeout. Place it at the top of the page.
Session.Timeout = 5
Regards.
janlee
05-01-2005, 08:00 AM
Thank you.
So I can writite at the top of the page:
<%
Is session.timeout =5 then
response.redirect("logout.asp"
end if
%>
JanLee
buntine
05-01-2005, 08:08 AM
Well, no. It works a bit differently to that.
You can only set the timeout property. You will need to use the global.asa file to perform an action when a session is destroyed.
Alsternatively, you can use the following method to detect if a session has been destroyed or is for some reason non-existant:
If IsEmpty(Session("NameOfSession")) Or Session("NameOfSession") = "" Then
Response.redirect("logout.asp")
End If
Regards.
You can use the collowing command to programmatically set the session timeout. Place it at the top of the page.
Session.Timeout = 5
Regards.
isnt timeout after inactivity though?
buntine
05-03-2005, 07:09 PM
Ahh, yes, that's right. I did not even think about that. :)
You would need to store the exact date/time the user logged in and then compare it with the current time each time a page is loaded. If there is more than a five minute space, notify the user and clear the session.
Regards.
Lebron Letchev
05-04-2005, 02:21 PM
Its envolves a lot of script. Right?
first you gotta capture their login time and date to a session object. then you just need a function at the top of all your pages that checks the value of the session variable and either displays the page they are on if they are within the time limit, or it redirects them to another page that explains the time limit or whatever. if the users are logging in through the script, there should already be a function checking at the top of each page. just add that little bit above for the time as well.
if you want some time in between logins, you will have to store their logout time in a database and check that when they try to log in again.