I have an asp.net application c# that uses session state to store a variable when the user logs in. This is their log in name and its used extensively throughout the user area. Problem is that the session keeps losing the information on certain computers. I dont know enough about session state really and i wanted to know why this was happening. An example. When a user goes through different selections on a grid, after about 2 mins the label which shows the session state variable on the screen is empty, causing problems for the person when they want to add a record as the database requires their username to stamp onto a record.
So in summary. what would cause a session state variable to lose its value after only a few minutes and not on all computers. ( i have no problem on my computer only on the clients machine- typical isnt it)
a little more information;
i use the session in the server side code, ie
session["username"] = username.Text;
and also the hosting i have is a shared hosting environment which means i have very little to do with the iis settings (fairly cheap job im afraid) Will try the web config change and report back . Thanks for all the answers.
if I understand your issue, you have to storage your session data out of process. You could use “State Server Mode” or “SQL Server Mode” if you have a SQLServer database.
Here you can find how to use http://msdn.microsoft.com/en-us/library/ms178586.aspx
Otherwise you can built a “custom session state store provider”, but I think that way is a bit more complicated.