Session.Timeout being ignored

C

Colin Steadman

I'm using the following code in my global.asa file to set the
session.timeout value amongst other things -

Sub Session_OnStart
Session.Timeout = 40
Session("Authenticated") = 1
End Sub

Yet when I print out the value of session.timeout on a page after this
event has fired it returns 20 (I get the right value for
Session("Authenticated") so my code appears to be working).

I checked the default timeout value in IIS (v5) on the server, but
this reads 900 seconds, which in my books is 15 minutes. I am
therefore very confused as to where this value of 20 is coming from.
Could anyone point me in the right direction as I need to set this to
40 minutes and my WROX manual doesn't provide much information on this
property.

TIA,

Colin
 
A

Aaron Bertrand - MVP

Why don't you set it in IIS, instead of setting it for every single session?
 
E

Evertjan.

Aaron Bertrand - MVP wrote on 05 jan 2004 in
microsoft.public.inetserver.asp.general:
Why don't you set it in IIS, instead of setting it for every single
session?

Aaron,
lots of us have no access to IIS settings,
happily using virtual servers.

Perhaps it could be set in Application_onStart ?
 
A

Aaron Bertrand - MVP

Aaron,
lots of us have no access to IIS settings,
happily using virtual servers.

I understand that. I only suggested it, because he said:

"I checked the default timeout value in IIS (v5) on the server,"

Which leads me to believe he DOES have access.
 
C

Colin Steadman

I understand that. I only suggested it, because he said:

"I checked the default timeout value in IIS (v5) on the server,"

Which leads me to believe he DOES have access.


I do have access to the server so technically I could change the
timeout value. But if I did it would appear I might upset the owners
of a few other websites being hosted on it.

I say this because looking at the way the server has been setup, it
has one 'Default Web Site' which hosts a number of virtual
directories, one of which is mine (is this what Evertjan refers to as
virtual servers?). I dont know a lot about IIS but looking under the
properties of the 'Default Web Site' and my virtual directory, I can
only see a timeout value in the properties for the 'Default Web Site'.
I'm assuming that my site (and the other virtual directories) inherit
their timeout values from here.

I dont know why IIS was setup like this. But since I cant change it,
I was hoping that the script I posted would achieve the same objective
for me. I'll have a look at Application_Onstart instead, maybe I'll
have more success with it.

Regards,

Colin
 
C

Colin Steadman

So why can't you make your site a separate site? Or define it as an
application?

I dont know. What would I need to setup a separate site, just another IP address?

Colin
 
B

Bob Barrows

Colin said:
I dont know. What would I need to setup a separate site, just
another IP address?

Colin

No, view the site's properties using IIS Manager. Click the Create
Application button and give it a name if you wish. Then you can configure
the site's settings separately from the other sites on the server.

Bob Barrows
 
D

Dominic Marsat

doesn't the 900 seconds refer to the connection time out, not the session
time out, usually set at twenty minutes?
 
B

Bob Barrows [MVP]

Dominic said:
doesn't the 900 seconds refer to the connection time out, not the
session time out, usually set at twenty minutes?
What "900 seconds"?

In the application properties page, there is a place to set session
timeout.Its default is 20 min.

Bob Barrows
 
D

Dominic Marsat

The first message of this thread was:

I checked the default timeout value in IIS (v5) on the server, but
this reads 900 seconds, which in my books is 15 minutes. I am
therefore very confused as to where this value of 20 is coming from.
Could anyone point me in the right direction as I need to set this to
40 minutes and my WROX manual doesn't provide much information on this
property.

It looks to me like there is confusion between the
connection time out (900 seconds) and the session
time out (20 mins).
 
B

Bob Barrows [MVP]

Dominic said:
The first message of this thread was:

I checked the default timeout value in IIS (v5) on the server, but
this reads 900 seconds, which in my books is 15 minutes. I am
therefore very confused as to where this value of 20 is coming from.
Could anyone point me in the right direction as I need to set this to
40 minutes and my WROX manual doesn't provide much information on this
property.

It looks to me like there is confusion between the
connection time out (900 seconds) and the session
time out (20 mins).

That may be, but I just realized that we are both replying to a thread that
has been dead for two months ... :)

I doubt the OP will even see these replies.

Bob Barrows
 

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

Members online

Forum statistics

Threads
474,146
Messages
2,570,831
Members
47,374
Latest member
anuragag27

Latest Threads

Top