PC Review
Forums
Newsgroups
Microsoft Word
Microsoft Frontpage
Increasing time outs
Forums
Newsgroups
Microsoft Word
Microsoft Frontpage
Increasing time outs
![]() |
Increasing time outs |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 %> |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 ============================================== "shikha" <shikha@discussions.microsoft.com> wrote in message news:42AAE064-FCE4-4CF0-ACE6-0CA9DEB77E6A@microsoft.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 > %> > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
And info on changing it is at http://www.devguru.com/Technologies...on_timeout.html
-- _____________________________________________ SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ] "Warning - Using the F1 Key will not break anything!" (-; _____________________________________________ "Thomas A. Rowe" <tarowe@mvps.org> wrote in message news:%23sVKEMylHHA.596@TK2MSFTNGP06.phx.gbl... | 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 | ============================================== | | | "shikha" <shikha@discussions.microsoft.com> wrote in message | news:42AAE064-FCE4-4CF0-ACE6-0CA9DEB77E6A@microsoft.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 | > %> | > | > | | |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

