Session Timeout Problem

G

GaryDean

The web.config in my asp.net application, running on Server2003, has this
entry: <sessionState mode="InProc" timeout="40".
In IIS the asp.net State Management timeout setting is 40 for my website.
In IIS the virtual directory configuration setting is set to 40.

The application still timesout at 20 minutes.

What else can I do?
 
B

bruce barker

you probably have asp.net configured to shutdown after 20 mins of idle.
this causes a recycle which loses all session data.

if you use inproc session, you will sometimes lose session data due to a
recycle, so your site should be coded to handle this case.

-- bruce (sqlwork.com)
 
S

Steven Cheng[MSFT]

Hi Gary,

As you mentioned that you've used three session setting, then what's the
actual session mode you use now, inproc one? I suggeset you create a
simplified application and use inproc session to verify the behavior.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

GaryDean

Could you be a little more specific?
I have asp.net configured to shutdown after 20 mins? where? how?
"site should be coded to handle this case? how?
 
G

GaryDean

Steven,
you ask "what's the actual session mode you use now" not sure I understand
your question. In my original post I stated the session settings in my
web.config and the setting is IIS. every conceivable setting I know of says
40 minutes but the application timesout after 20 minutes.
 
J

Juan T. Llibre

re:
!> I have asp.net configured to shutdown after 20 mins? where? how?

20 minutes is the default.
If you don't have a timeout configured...you'll get a 20 minute timeout.

To get back to the problem, are you using Forms Authentication ?
Could *that* be set to 20 minutes ?
 
J

Juan T. Llibre

re:
!> every conceivable setting I know of says
!> 40 minutes but the application timesout after 20 minutes.

Including the Forms Authentication timeout ( if you're using that ? ).
*That* defaults to 20 minutes, too.
 
G

GaryDean

I believe that timeout default is 30, but yes I also set the Forms
Authentication timout to 40.
 
J

Juan T. Llibre

If you have set all the timeouts to 40, and the app is still losing the session variables
at 20, then either the app is recycling at 20 or the application pool is recycling at 20.

Have you attempted to set a different recycling threshold in the IIS Manager ?

Also, have you tried to use State Server, instead of InProc ?

State Server, as does SQL Server, gets around the loss of
session variables due to Application/App Pool recycling.
 
G

GaryDean

I've goolged and looked everywhere I can and I can't find anything on
"recycling threshold settings" in IIS. My original question at the
beginning of this thread stands.
 
J

Juan T. Llibre

In Windows Server 2003, you can set the recycling threshhold
for the Application Pool in which an application runs.

In the IIS Manager, scroll down the left hand panel to "Application Pools",
and select the Application Pool in which your app runs.

Right-click the App Pool and select "Properties" from the context menu.

You'll see several options for setting the time/memory limit/number of requests
at which the application pool will be recycled.

Just make sure your time setting isn't set too low.
Leave the rest untouched until you are familiar with the settings.

You don't say whether you tried using State Server.

!> Also, have you tried to use State Server, instead of InProc state management?

!> State Server state management, as does SQL Server, gets around
!> the loss of session variables due to Application/App Pool recycling.

Just configure it in web.config :

<sessionState
mode="StateServer"
stateConnectionString="tcpip=127.0.0.1:42424"
stateNetworkTimeout="10"
cookieless="false"
timeout="20"
/>

....and in the "Services" applet of the W2K3 Server, start the State Server service.

That usually works to prevent Session variable losses.
 
G

GaryDean

Juan,
That was it. The other settings had already extended my Session.timeout but
then we were getting null session variables after 20 minutes. I didn't try
State Server because we just don't need it now for this low-arrival rate
app.

Thank you very much for your help on this issue.

Regards,
Gary Blakely
 
J

Juan T. Llibre

re:
!> Juan,
!> That was it.

Glad to hear that!

re:
!> Thank you very much for your help on this issue.

You're quite welcome. Glad to know you're up and running trouble-free again.
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top