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