Session Does Not Time Out

G

Guest

My session do not appear to be timing out. When I save something in ViewState, my expectation is that if no interaction occurs within the specified time, that the session variable would be null. Is that not the case? Here are the parameters in my 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"
/

So why does it not time out? Or do I not understand timeout correctly? Or is some value in the Machine.config overriding

Thanks in advance for your assistance!!!!!!!!
 
B

bruce barker

viewstate is stored in a hidden field sent to the client, and has nothing to
do with sessions.

-- bruce (sqlwork.com)


Jim Heavey said:
My session do not appear to be timing out. When I save something in
ViewState, my expectation is that if no interaction occurs within the
specified time, that the session variable would be null. Is that not the
case? Here are the parameters in my 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"
/>

So why does it not time out? Or do I not understand timeout correctly?
Or is some value in the Machine.config overriding?
 
S

Saravana [MVP]

Timeout metioned in this config file correct, your session should timeout in
20 mins. Machine.config setting will be overridden by settings in web.config
in virtual folder. So you no need to worry about that. But i have some doubt
in your question, you are talking about viewstate. But viewstate and session
are not related anyway. If you store some value in viewstate, it is stored
in hidden value which will exists till you post back. If i am not clear, get
back to me.

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com



Jim Heavey said:
My session do not appear to be timing out. When I save something in
ViewState, my expectation is that if no interaction occurs within the
specified time, that the session variable would be null. Is that not the
case? Here are the parameters in my 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"
/>

So why does it not time out? Or do I not understand timeout correctly?
Or is some value in the Machine.config overriding?
 
S

Saravana [MVP]

If you tell us exactly what you want to do, then we will able to guide you.

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com



Jim Heavey said:
OK, Viewstate does not have a "timeout" associated with it and will never cause a timeout.
If I want to ensure that a request will time out, I must use a "Session"
variable? How about the cookies which are being created behind the scenes,
will they not time out? I put all of this code into handle timeout and now
I can not figure out how to cause the condition to test the code that I put
in for that condition.....
 

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

Top