Forums

This topic is locked

URGENT!!! Session.Timeout

Posted 23 May 2003 16:08:21
1
has voted
23 May 2003 16:08:21 Carlos Leal posted:
Hi,

I have this code in all my pages:

<pre id=code><font face=courier size=2 id=code>
&lt;%@LANGUAGE="JAVASCRIPT"%&gt;
&lt;!--#include file="Connections/gestarea.asp" --&gt;
<font color=red>&lt;% Session.Timeout = 60 %&gt;</font id=red>
&lt;%
// *** Restrict Access To Page: Grant or deny access to this page
var MM_authorizedUsers="Admin,Vend,Ind,Ang";
var MM_authFailedURL="gestarea_nacesso.asp";
var MM_grantAccess=false;
if (String(Session("MM_Username") != "undefined" {
if (true || (String(Session("MM_UserAuthorization")=="" || (MM_authorizedUsers.indexOf(String(Session("MM_UserAuthorization")) &gt;=0)) {
MM_grantAccess = true;
}
}
if (!MM_grantAccess) {
var MM_qsChar = "?";
if (MM_authFailedURL.indexOf("?" &gt;= 0) MM_qsChar = "&";
var MM_referrer = Request.ServerVariables("URL";
if (String(Request.QueryString()).length &gt; 0) MM_referrer = MM_referrer + "?" + String(Request.QueryString());
MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + Server.URLEncode(MM_referrer);
Response.Redirect(MM_authFailedURL);
}
%&gt;
</font id=code></pre id=code>

I was trying that the session was about 1 hour but still 20 minutes, can someone tell me what is wrong?

Thanks in advance
Carlos Leal

Edited by - carlosleal on 23 May 2003 17:06:51

Replies

Replied 27 May 2003 08:59:10
27 May 2003 08:59:10 Vince Baker replied:
In IIS there is a setting for the timeout duration of a session variable. As default, this is set to 20 mins. I beleive that you will need to change this setting to increase the life of a session variable.

If you do not have access to do this how about using a cookie instead?

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 30 May 2003 20:59:23
30 May 2003 20:59:23 Mark Drelinger replied:
I found this program on Microsoft site to change the session timeout...it is set to 20 minutes by default...I changed it to 240 minutes...

Run this to change the number of minutes a Session is open without activity: Run on the server from run line: (This sets it to 4 hours or 240 minutes):

C:\WINNT\system32\dllcache\CScript.exe C:\inetpub\adminScripts\adsutil.vbs set w3svc/AspSessionTimeOut 240
Hi,

I have this code in all my pages:

<pre id=code><font face=courier size=2 id=code>
&lt;%@LANGUAGE="JAVASCRIPT"%&gt;
&lt;!--#include file="Connections/gestarea.asp" --&gt;
<font color=red>&lt;% Session.Timeout = 60 %&gt;</font id=red>
&lt;%
// *** Restrict Access To Page: Grant or deny access to this page
var MM_authorizedUsers="Admin,Vend,Ind,Ang";
var MM_authFailedURL="gestarea_nacesso.asp";
var MM_grantAccess=false;
if (String(Session("MM_Username") != "undefined" {
if (true || (String(Session("MM_UserAuthorization")=="" || (MM_authorizedUsers.indexOf(String(Session("MM_UserAuthorization")) &gt;=0)) {
MM_grantAccess = true;
}
}
if (!MM_grantAccess) {
var MM_qsChar = "?";
if (MM_authFailedURL.indexOf("?" &gt;= 0) MM_qsChar = "&";
var MM_referrer = Request.ServerVariables("URL";
if (String(Request.QueryString()).length &gt; 0) MM_referrer = MM_referrer + "?" + String(Request.QueryString());
MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + Server.URLEncode(MM_referrer);
Response.Redirect(MM_authFailedURL);
}
%&gt;
</font id=code></pre id=code>

I was trying that the session was about 1 hour but still 20 minutes, can someone tell me what is wrong?

Thanks in advance
Carlos Leal

Edited by - carlosleal on 23 May 2003 17:06:51

Reply to this topic