I'm trying to make a Session last for 2 hours but just can't seem to make it work.
i have this code in web.config
and then try and set session.timeout when a session begin ie.Code:<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="120" />
VB Code:
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) ' Fires when the session is started Session.Timeout = 120 End Sub
If in debug mode i use a breakpoint and check the value of Session.timeout it does indeed equal 120, yet the Session never lasts that long when i test it by leaving it alone, say for 30 mins then i come back to it run a little test that tests session values only to find the session has ended.
Anyone know any idea why this is happening?
Is 2 hours just to long to hold Session? if so why is session.timeout an integer (in minutes)?
Thanks for any help.




Reply With Quote