Reputation: 3685
I have a ASP.NET Application where I use Sessions. In this Session I get the language for Example.
Example:
Session["language"] = language;
And in a other Area in my Code I use then...
language = Session["language"].toString();
It works fine but the user had open the Browser about a feu Hours in the Background with the Application then the Session don't work :(
Why it doesn't work and how I can solve this Problem.
Upvotes: 1
Views: 2096
Reputation: 13150
You have two options either to use cookies or to increase session timeout setting.
You can increase the session timeout by increasing timeout in the web.config
.
<configuration>
<system.web>
...
<sessionState timeout="90" />
...
</system.web>
</configuration>
In my opinion using cookies is a better approach.
Upvotes: 2