My problem is that this ID seems to get lost every now and then,resetting to 0. How can I get my server to store the userID in asession for a set duration after the last refresh?
Hi,
What is the timeout you have specified for the session in the web.config. Try increasing the timeout.
Thanks.
There is no information on timeouts in my webconfig.
Where can I find information on how to add this?
Thank you/
Hi,
Try to locate the following in your web.config
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
You need to change it in the above (timeout).
Thanks.
The timeout is not with my database.
The timeout is because the userID stored in the session is being lost.How do I increase the time that a session variable is stored?
Sorry, my mistake. I thought he was setting the database timeout because I saw the connection string.
I'll try it and let you know how it goes.
Thank you.
What ranganh said is correct
The session variable will persist until the time out specified in the web.config is reached
or you cleared it in the code by removing the variable from session or by using
Session.Clear() or Session.Abandon() methods.
0 comments:
Post a Comment