How does the session timeout work?

L

Lars Netzel

There's a setting in the IIS where I have set Enabled Session Timeout to 20
minutes

Then there's a setting in the WebConfig file..
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20"/>

Where I have set the timeout property to 20..

But seriously when you run the application.. it feels like the timeout is
about 5 minutes or actually even a limit of 20 minutes for beeing logged in
period. Sometimes I can be working and I get thrown out anywway even if I
haven't left the application longer than a few seconds.

How do I make the correct settings for a Timeout of 20 minutes?



Best Regards/

Lars Netzel
 
Y

Yunus Emre ALPÖZEN

If you are using SQL Server to hold session data this settings will be
important. Otherwise, it would be ignored.
There are two types of session settings.
First, Session object's timeout property. You should set this property when
a session is started.
Second, application configuration. Right Click my computer choose manage.
From Services and Applications, choose Internet Information Services -
Default Web Site and your application. Right Click your application. Choose
properties. On Directory Tab, click Configuration button. From the options
tab set session time out.

I'm not sure, which will override given settings. But this two settings will
help u to overcome this issue.
 
J

Juan T. Llibre

Hi, Lars.

If you use "In Process" state management ( InProc ),
whenever the ASP.NET worker process is recycled
your session variables will get lost.

The new process has no way to know
what the previous process variables were.

To preserve session contents when the recycling of an ASP.NET
worker process occurs, you must use either "State Server" or
"SQL Server" state management.

They both work "out of process", i.e., in a different worker process
than the one ASP.NET uses, so when the ASP.NET worker process
is recycled, the state management worker process continues to work
and your session data isn't lost.

best regards,



Juan T. Llibre
ASP.NET MVP
===========
 

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,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top