Forums
This topic is locked
Session for Login Server Behavior
Posted 06 Aug 2005 01:32:11
1
has voted
06 Aug 2005 01:32:11 Teresa Pangan posted:
HI!Problem: Users of admin area are getting knocked out nearly right after logging in.
I have an admin area where admin users login to a page with Log In UltraDev Behavior using the setting for Restrict Access the username, password and access level. I am using ASP/BVScript
Then on pages in the admin area I inserted the Restrict Access Server Behavior that has username, password and a defined access level.
It is working, users can login and view pages in the admin area, however, the behavior is knocking users out in time significantly less than 20 minutes. My understanding is the default for a session variable is 20 minutes. It seems like 2 minutes I have to relogin and if I was entering new data, it is lost.
Suggestions on setting it up so this doesn't occur?
Or can I change the time out for the session variable to 60 minutes or 90 minutes?
Has this happened to anyone else?
Thanks in advance for your help.
Teresa
MX 2004/Access/ASP/VBScript
Replies
Replied 06 Aug 2005 06:13:02
06 Aug 2005 06:13:02 Jeremy Conn replied:
<% Server.ScriptTimeout = 1000 %>
where 1000 = how many seconds you want to allow
<b>Connman21</b>
www.conncreativemedia.com
DWMX2004 | ASP/VB | IIS5 | Access/SQL2000
where 1000 = how many seconds you want to allow
<b>Connman21</b>
www.conncreativemedia.com
DWMX2004 | ASP/VB | IIS5 | Access/SQL2000
Replied 06 Aug 2005 09:49:20
06 Aug 2005 09:49:20 Teresa Pangan replied:
HI Jeremy!
Thanks!
Where do I insert the session time parameter? Here is the login coding:
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL"
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("userid"
)
If MM_valUsername <> "" Then
MM_fldUserAuthorization="AccessCode"
MM_redirectLoginSuccess="admin/index.asp"
MM_redirectLoginFailed="admin/failed.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_connLutheran_STRING
MM_rsUser.Source = "SELECT Userid, Password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM tblAdmin WHERE Userid='" & Replace(MM_valUsername,"'","''"
&"' AND Password='" & Replace(Request.Form("password"
,"'","''"
& "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username"
= MM_valUsername
If (MM_fldUserAuthorization <> ""
Then
Session("MM_UserAuthorization"
= CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization"
= ""
End If
if CStr(Request.QueryString("accessdenied"
) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied"
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
Thanks for your help!!
Teresa
Thanks!
Where do I insert the session time parameter? Here is the login coding:
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL"
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("userid"
If MM_valUsername <> "" Then
MM_fldUserAuthorization="AccessCode"
MM_redirectLoginSuccess="admin/index.asp"
MM_redirectLoginFailed="admin/failed.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_connLutheran_STRING
MM_rsUser.Source = "SELECT Userid, Password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM tblAdmin WHERE Userid='" & Replace(MM_valUsername,"'","''"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username"
If (MM_fldUserAuthorization <> ""
Session("MM_UserAuthorization"
Else
Session("MM_UserAuthorization"
End If
if CStr(Request.QueryString("accessdenied"
MM_redirectLoginSuccess = Request.QueryString("accessdenied"
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
Thanks for your help!!
Teresa
Replied 08 Aug 2005 16:09:10
08 Aug 2005 16:09:10 Jeremy Conn replied:
Just below your <%@LANGUAGE="VBSCRIPT"%> code is where I usually put it... I don't think it matter as long as it is above the <HTML> tag.
<b>Connman21</b>
www.conncreativemedia.com
DWMX2004 | ASP/VB | IIS5 | Access/SQL2000
<b>Connman21</b>
www.conncreativemedia.com
DWMX2004 | ASP/VB | IIS5 | Access/SQL2000
