Click to See Complete Forum and Search --> : ASP Session time out problem


akrashdi
10-10-2006, 04:44 PM
I'm trying to increase session time but it logs me out after few minutes. Heres the code :

<%
'-------LOGIN AND SESSION
If Session("user_name") = "" then
user_name = Request("user_name")
password = Request("password")

Set stafflogin = Server.CreateObject("ADODB.Recordset")
stafflogin.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\business\caravanhajj.com\private\hajjdb.mdb"
stafflogin.Source = "SELECT * FROM staff WHERE user_name = '" & user_name & "' AND password = '" & password & "'"
stafflogin.Open

If stafflogin.EOF then
Response.redirect("staff_login.asp?cp=10")
else
Session("user_name") = user_name
End if
elseif Session("user_name") <> "" then
Set stafflogin = Server.CreateObject("ADODB.Recordset")
stafflogin.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\business\caravanhajj.com\private\hajjdb.mdb"
stafflogin.Source = "SELECT * FROM staff WHERE user_name = '" & Session("user_name") & "'"
stafflogin.Open
user_name = Session("user_name")
End if

Session.Timeout=200

%>

akrashdi
10-21-2006, 12:16 AM
Hello !

I.m.I
10-21-2006, 06:17 PM
i think it must work or try to put the seesion.timeout in first line

Atrix256
10-31-2006, 01:44 PM
I think that the duration is measured in seconds.

200 seconds = 3 minutes and 20 seconds and since you said you time out in a couple of minutes that sure sounds fishy doesn't it? (:

russell
11-01-2006, 11:18 AM
Session.Timeout is indeed measured in seconds. And it should be 1st line of code -- even better in Global.asa.

Session timeout can be set in IIS mmc, and set so that code cant override it. need to check settings there (or ask host if hosted site)