Increasing time outs

S

shikha

Hi Everyone,

I have a website where users enter login information to log on, and each
page is password protected. It times out every 5 mins or so it there is no
activity. I am not too sure how to increase the limit so instead of every 5
mins...it will be 30 mins or so...

Any help will be greatly appreciated!!!!
Here is my login.inc file


<% Response.CacheControl = "no-cache"


' Check to see whether you have a current user name.
If isLP Then'Are you currently on the logon page?
Session("REFERRER")=Request.ServerVariables("URL")
Response.Redirect("./")
End If

function isLP()'do not modify this function may cause an icorrect running
on error resume next
isLP=False
If Len(Session("uid"))=0 then
if isEmpty(LPage) Then
isLP=True
End If
end if
end function

' This function checks for a username/password combination.
Function ComparePassword(uid,pwd)
' Define your variables.
Dim strSQL, objCN, objRS
' Set up your SQL string.
strSQL = "SELECT * FROM " & USERS_TABLE & " WHERE (UID='" & uid & "' AND
PWD='" & pwd & "');"
' Create a database connection object.
Set objCN = Server.CreateObject("ADODB.Connection")
' Open the database connection object.
'objCN.Open "driver={Microsoft Access Driver (*.mdb)}; dbq=" &
Server.MapPath(MDB_URL) & "; uid=admin; pwd="
objCN.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath(MDB_URL), dbUserName, dbPassword
' Run the database query.
Set objRS = objCN.Execute(strSQL)
if Not objRS.EOF then
if len(objRS("Admin"))=4 then
Session("admin")="1" ' TRUE or true = 4 it's a little trick
else Session("admin")=Empty
end if
if len(objRS("Enabled"))=4 then
Session("enabled")="1"
else Session("enabled")=Empty
end if
ComparePassword = True
else
ComparePassword = False 'Wrong UID or PWD
end if
' Close your database objects.
Set objRS = Nothing
Set objCN = Nothing
End Function

Function isLogged() ' Function Return True for Logged User, something like
this must called in the begin of each protected asp file.
if Len(Session("uid"))=0 then
isLogged=False
else isLogged=True
end if
End Function

Function logState() ' Function Return String Shows user state in system and
logout text link
If Len(Session("uid")) = 0 Then
Response.Write "<p><b>You are not logged on.</b></p>"
Else
Response.Write "<p>You are logged on as: <b>" & Session("uid") &
"</b> | <a href='" & LOGOUT_PAGE & "'>Logout</a></p>"
End If
End Function

Function isAdmin() 'Function Return True for Admin and Else for other users.
isAdmin=Cbool(Len(Session("admin")))
End function

Function isEnabled() ' Function return True for Enabled users and Else for
others.
isEnabled=CBool(Len(Session("enabled")))
End function
%>
 
T

Thomas A. Rowe

Unless you have added code to change the session or your web host changed the default session value
of 20 mins.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
S

Stefan B Rusynko

And info on changing it is at http://www.devguru.com/Technologies/asp/quickref/session_timeout.html

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Unless you have added code to change the session or your web host changed the default session value
| of 20 mins.
|
| --
| ==============================================
| Thomas A. Rowe
| Microsoft MVP - FrontPage
|
| http://www.Ecom-Data.com
| ==============================================
|
|
| | > Hi Everyone,
| >
| > I have a website where users enter login information to log on, and each
| > page is password protected. It times out every 5 mins or so it there is no
| > activity. I am not too sure how to increase the limit so instead of every 5
| > mins...it will be 30 mins or so...
| >
| > Any help will be greatly appreciated!!!!
| > Here is my login.inc file
| >
| >
| > <% Response.CacheControl = "no-cache"
| >
| >
| > ' Check to see whether you have a current user name.
| > If isLP Then'Are you currently on the logon page?
| > Session("REFERRER")=Request.ServerVariables("URL")
| > Response.Redirect("./")
| > End If
| >
| > function isLP()'do not modify this function may cause an icorrect running
| > on error resume next
| > isLP=False
| > If Len(Session("uid"))=0 then
| > if isEmpty(LPage) Then
| > isLP=True
| > End If
| > end if
| > end function
| >
| > ' This function checks for a username/password combination.
| > Function ComparePassword(uid,pwd)
| > ' Define your variables.
| > Dim strSQL, objCN, objRS
| > ' Set up your SQL string.
| > strSQL = "SELECT * FROM " & USERS_TABLE & " WHERE (UID='" & uid & "' AND
| > PWD='" & pwd & "');"
| > ' Create a database connection object.
| > Set objCN = Server.CreateObject("ADODB.Connection")
| > ' Open the database connection object.
| > 'objCN.Open "driver={Microsoft Access Driver (*.mdb)}; dbq=" &
| > Server.MapPath(MDB_URL) & "; uid=admin; pwd="
| > objCN.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" &
| > Server.MapPath(MDB_URL), dbUserName, dbPassword
| > ' Run the database query.
| > Set objRS = objCN.Execute(strSQL)
| > if Not objRS.EOF then
| > if len(objRS("Admin"))=4 then
| > Session("admin")="1" ' TRUE or true = 4 it's a little trick
| > else Session("admin")=Empty
| > end if
| > if len(objRS("Enabled"))=4 then
| > Session("enabled")="1"
| > else Session("enabled")=Empty
| > end if
| > ComparePassword = True
| > else
| > ComparePassword = False 'Wrong UID or PWD
| > end if
| > ' Close your database objects.
| > Set objRS = Nothing
| > Set objCN = Nothing
| > End Function
| >
| > Function isLogged() ' Function Return True for Logged User, something like
| > this must called in the begin of each protected asp file.
| > if Len(Session("uid"))=0 then
| > isLogged=False
| > else isLogged=True
| > end if
| > End Function
| >
| > Function logState() ' Function Return String Shows user state in system and
| > logout text link
| > If Len(Session("uid")) = 0 Then
| > Response.Write "<p><b>You are not logged on.</b></p>"
| > Else
| > Response.Write "<p>You are logged on as: <b>" & Session("uid") &
| > "</b> | <a href='" & LOGOUT_PAGE & "'>Logout</a></p>"
| > End If
| > End Function
| >
| > Function isAdmin() 'Function Return True for Admin and Else for other users.
| > isAdmin=Cbool(Len(Session("admin")))
| > End function
| >
| > Function isEnabled() ' Function return True for Enabled users and Else for
| > others.
| > isEnabled=CBool(Len(Session("enabled")))
| > End function
| > %>
| >
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top