PC Review Forums Newsgroups Microsoft Word Microsoft Frontpage Increasing time outs

Reply

Increasing time outs

 
Thread Tools Rate Thread
Old 15-05-2007, 06:35 PM   #1
=?Utf-8?B?c2hpa2hh?=
Guest
 
Posts: n/a
Default Increasing time outs


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
%>


  Reply With Quote
Old 15-05-2007, 06:58 PM   #2
Thomas A. Rowe
Guest
 
Posts: n/a
Default Re: Increasing time outs

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
> %>
>
>



  Reply With Quote
Old 16-05-2007, 08:21 AM   #3
Stefan B Rusynko
Guest
 
Posts: n/a
Default Re: Increasing time outs

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
| > %>
| >
| >
|
|


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off