472,958 Members | 2,319 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

session state variables expiring too quickly

In the web.config file for my application, in the <sessionState>
section I have set timeout="120" (in minutes), but session state
variables in my application seem to be expiring in about 5 minutes.
Any idea what could cause this?

I have the mode="InProc" attribute set for <sessionState>. I know that
some people have solved the problem of session variables timing out too
quickly by changing that attribute, but I cannot use mode="StateServer"
because my ASP.Net host doesn't support running a state server on the
shared host, and I can't use mode="SQLServer" because I don't have the
admin rights on my host's SQL Server to set up the SQL Server session
state database. (I tried running the InstallSqlState.sql script on my
host's SQL Server database and got a bunch of access denied errors.)

I realize this can happen occasionally if the server is rebooted or
ASP.Net is restarted, but with my host's server it's consistent; the
values *always* die within five minutes. One thread at
http://www.gotdotnet.com/Community/M....aspx?id=17380
suggested that sporadic dying of session state variables might have
something to do with an anti-virus program running on the host, but in
my case it happens every time.

I'm developing the app on my local IIS Web server and then using Visual
Studio's Project->Copy Project function to copy the project to the
remote host. When the application runs on my local machine, the
session variables do not time out in 5 minutes, but when it's copied to
the remote server, they do. This leads me to think it's not something
in the project files but some configuration setting in IIS, but the
question is, what? More importantly, is there something I can change
in my project to make session state variables last longer in all cases,
independent of whatever IIS setting is breaking it?

My host says that in the Properties for my web site in IIS, they have
the HTTP "Connection timeout" set to 120 (expressed in seconds; the
default is 900). (This is not the same as the session timeout
setting.) Could that have anything to do with it? But I tried setting
connection timeout to 120 on my local IIS and my local application's
session vars still didn't die after 5 minutes. (I wouldn't expect the
Connection timeout to have anything to do with it anyway, because I
thought ASP.Net uses cookies -- or query strings in the case of
cookie-less sessions -- to associate your browser with your current
session, and that will work even if the HTTP connection dies, as long
as your session hasn't expired on the server yet. Wouldn't it?)

Any help would be extremely appreciated,

-Bennett

Nov 19 '05 #1
3 3272
Hi Bennett,

I would agree that the problem lies on your hosted server, and with its
configuration somehow. Of course, the hosted web server is a black box to
you, but not to the network administrators on your hosted server. Rather
than trying to circumvent an unknown issue, I would recommend communicating
with the support personnel on your hosting service. Yes, I know that this is
likely to be a pain in the butt, as you will probably have to work your way
up the food chain until you get someone with some real technical knowledge
Perhaps it would help to think of the process as giving entry-level wannabes
some real problem-solving experience, or at least convincing some of them
that they should go into another line of work.

At any rate, somewhere on that hosting service is a real network admin, who
knows how the .Net platform works, and how it affects their network, as well
as what sort of configuration they have, and how it might affect hosted
ASP.Net apps. Or, you're hosting with some fly-by-night hosting service that
can't think their way out of a paper bag, in which case you will find that
out and in the process, find a decent hosting service somewhere else!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

<be*****@peacefire.org> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
In the web.config file for my application, in the <sessionState>
section I have set timeout="120" (in minutes), but session state
variables in my application seem to be expiring in about 5 minutes.
Any idea what could cause this?

I have the mode="InProc" attribute set for <sessionState>. I know that
some people have solved the problem of session variables timing out too
quickly by changing that attribute, but I cannot use mode="StateServer"
because my ASP.Net host doesn't support running a state server on the
shared host, and I can't use mode="SQLServer" because I don't have the
admin rights on my host's SQL Server to set up the SQL Server session
state database. (I tried running the InstallSqlState.sql script on my
host's SQL Server database and got a bunch of access denied errors.)

I realize this can happen occasionally if the server is rebooted or
ASP.Net is restarted, but with my host's server it's consistent; the
values *always* die within five minutes. One thread at
http://www.gotdotnet.com/Community/M....aspx?id=17380
suggested that sporadic dying of session state variables might have
something to do with an anti-virus program running on the host, but in
my case it happens every time.

I'm developing the app on my local IIS Web server and then using Visual
Studio's Project->Copy Project function to copy the project to the
remote host. When the application runs on my local machine, the
session variables do not time out in 5 minutes, but when it's copied to
the remote server, they do. This leads me to think it's not something
in the project files but some configuration setting in IIS, but the
question is, what? More importantly, is there something I can change
in my project to make session state variables last longer in all cases,
independent of whatever IIS setting is breaking it?

My host says that in the Properties for my web site in IIS, they have
the HTTP "Connection timeout" set to 120 (expressed in seconds; the
default is 900). (This is not the same as the session timeout
setting.) Could that have anything to do with it? But I tried setting
connection timeout to 120 on my local IIS and my local application's
session vars still didn't die after 5 minutes. (I wouldn't expect the
Connection timeout to have anything to do with it anyway, because I
thought ASP.Net uses cookies -- or query strings in the case of
cookie-less sessions -- to associate your browser with your current
session, and that will work even if the HTTP connection dies, as long
as your session hasn't expired on the server yet. Wouldn't it?)

Any help would be extremely appreciated,

-Bennett

Nov 19 '05 #2
Actually that did work. Turns out they automatically cycle any
application on their server that's idle for more than five minutes, and
as I was the only person using this particular app while I was testing
it, that's what was happening. I got them to up the idle time to 20
minutes and I have a scheduled job that hits a script on the site every
15 minutes now to stop it from idling out at all, and now it is able to
maintain session variables for at least 1.5 hours (when I have the
sessionState timeout set to 120 minutes in web.config). Thanks!

Nov 19 '05 #3
Check your <processModel responseDeadlockInterval setting
and set a maximum value that is at least the same as your longest
application-level timeout setting.

responseDeadlockInterval="hrs:mins:secs|Infinite"

In your case, that would be :

responseDeadlockInterval="2:00:00"
since you have set your session timeout for 120 minutes.

This may not be the specific solution for your p[roblem,
but it may be one less thing to worry about, and it doesn't
cost you anything to try it.

When the ASP.NET worker process has been idle for the duration that is
specified in the responseDeadlockInterval configuration setting, it causes
the deadlock detection mechanism to restart the worker process, losing your
session data if you're running sessionState Inproc.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

<be*****@peacefire.org> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
In the web.config file for my application, in the <sessionState>
section I have set timeout="120" (in minutes), but session state
variables in my application seem to be expiring in about 5 minutes.
Any idea what could cause this?

I have the mode="InProc" attribute set for <sessionState>. I know that
some people have solved the problem of session variables timing out too
quickly by changing that attribute, but I cannot use mode="StateServer"
because my ASP.Net host doesn't support running a state server on the
shared host, and I can't use mode="SQLServer" because I don't have the
admin rights on my host's SQL Server to set up the SQL Server session
state database. (I tried running the InstallSqlState.sql script on my
host's SQL Server database and got a bunch of access denied errors.)

I realize this can happen occasionally if the server is rebooted or
ASP.Net is restarted, but with my host's server it's consistent; the
values *always* die within five minutes. One thread at
http://www.gotdotnet.com/Community/M....aspx?id=17380
suggested that sporadic dying of session state variables might have
something to do with an anti-virus program running on the host, but in
my case it happens every time.

I'm developing the app on my local IIS Web server and then using Visual
Studio's Project->Copy Project function to copy the project to the
remote host. When the application runs on my local machine, the
session variables do not time out in 5 minutes, but when it's copied to
the remote server, they do. This leads me to think it's not something
in the project files but some configuration setting in IIS, but the
question is, what? More importantly, is there something I can change
in my project to make session state variables last longer in all cases,
independent of whatever IIS setting is breaking it?

My host says that in the Properties for my web site in IIS, they have
the HTTP "Connection timeout" set to 120 (expressed in seconds; the
default is 900). (This is not the same as the session timeout
setting.) Could that have anything to do with it? But I tried setting
connection timeout to 120 on my local IIS and my local application's
session vars still didn't die after 5 minutes. (I wouldn't expect the
Connection timeout to have anything to do with it anyway, because I
thought ASP.Net uses cookies -- or query strings in the case of
cookie-less sessions -- to associate your browser with your current
session, and that will work even if the HTTP connection dies, as long
as your session hasn't expired on the server yet. Wouldn't it?)

Any help would be extremely appreciated,

-Bennett

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hans Kesting | last post by:
Hi, When the Session_OnEnd event fires, do the Session variables still exist? I want to do some cleanup (update some records in a database etc.), but then I need to know *which* recopds to...
3
by: Matt Mercer | last post by:
Hi all, I have read much about session variables and the pros and cons. I want to post my use and get opinions. When a user logs into my site various fields are pulled from a SQL user table....
1
by: ACaunter | last post by:
Hi all when i log onto my asp.net website through a browser , the session variables are expiring way too quickly. if i leave the screen for only a minute, everything is gone. it seems like some...
5
by: jensen bredal | last post by:
I need to keep track on user "session data" while still turning session off as i do not want users login to expire? Thanks JB
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
6
by: Eric McVicker | last post by:
Session state has options to be inproc, state server or sql server. Why does Application state not allow for state server or sql server so the same Application state could be shared between...
1
by: Jacob Arthur | last post by:
We are using Forms authentication in a webapp (ASP.net 1.1 VB, IIS6 on W2003) we created to maintain information on the currently logged-in user and their capabilities. After logging in, the user...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
1
by: csgraham74 | last post by:
Hi Guys, Im currently going round in circles with a session state issue on an asp.net vb application. Basically session state is constantly expiring after about a few clicks through my...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.