Menu
Can anyone tell me why my sessions don’t last for 60 minutes. I’ve set the session timeout for 60 minutes in my global.asa file, in the application configuration for the site, in the ASP.NET configuration for the site, and for the ASP.NET global configuration. My sessions timeout at 20 minutes mostly but they also timeout at 30, 40, and 60 minutes. I have multiple sites on this server, but only this one site needs to be set at 60 minutes. Also, can anyone tell me the heirarchy for the session timeout feature. Thanks!
[CODE]
<script Language="VBScript" RUNAT=Server>
Sub Session_OnStart()
Session.Timeout = 60
End Sub
Sub Session_OnEnd()
If Session("strSessionID") <> "" then
Dim connKeiger
Set connKeiger = Server.CreateObject("ADODB.Connection")
connKeiger.ConnectionString = "DSN=Keiger.dsn"
connKeiger.Open
Dim rsInterfaceLogins
Dim rsInterfacePages
Dim strSelect
Set rsInterfaceLogins = Server.CreateObject("ADODB.Recordset")
strSelect = "SELECT LoginID, SessionID, User, LoginDate, LoginTime, LogoutDate, LogoutTime, AutoLogout FROM tblInterfaceLogins WHERE SessionID = '" & Session("strSessionID") & "'"
rsInterfaceLogins.Open strSelect, connKeiger, , adLockPessimistic
rsInterfaceLogins("LogoutDate") = Date
rsInterfaceLogins("LogoutTime") = Time
If Session("strAutoLogout") = "Yes" or Session("strAutoLogout") = "" then
rsInterfaceLogins("AutoLogout") = "True"
End If
rsInterfaceLogins.Update
rsInterfaceLogins.Close
Set rsInterfaceLogins = Nothing
Set rsInterfacePages = Server.CreateObject("ADODB.Recordset")
strSelect = "SELECT * FROM tblInterfacePages WHERE SessionID = '" & Session("strSessionID") & "' ORDER BY PageDate DESC"
rsInterfacePages.Open strSelect, connKeiger, , adLockPessimistic
If IsNull(rsInterfacePages("PageOutDate")) and IsNull(rsInterfacePages("PageOutTime")) then
rsInterfacePages("PageOutDate") = Date
rsInterfacePages("PageOutTime") = Time
rsInterfacePages.Update
End If
rsInterfacePages.Close
Set rsInterfacePages = Nothing
connKeiger.Close
Set connKeiger = Nothing
End If
End Sub
</script>
[/CODE]
1.) The session.timeout value is getting overwrote somewhere on your site.[/QUOTE]
2.) Something is ending your session when it shouldn't.[/QUOTE]
Is this something that started recently? If that is true, look at files that you have changed recently to make sure that they aren't ending the session or playing with the timeout value.[/QUOTE]
You say you are running many sites. Are they all sharing the same domain?
www.website.com/webby1
www.website.com/webby2 [/QUOTE]
I believe that these all share one common global.asa.[/QUOTE]
One problem that you might run into is let's say you have some constants for each site. Those constants will overwrite your timeout in your global.asa file. I hope this helps.[/QUOTE]
[CODE]
<%
strAdminEmail = "[email protected]"
strSQLConnction = "Long ass sql connection string here"
session.timeout = 20
%>[/CODE]
0.1.9 — BETA 6.4