Q:

How I can use a Session for a long time in my ASP.NET Application

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.

A:

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.

Beginners Guide To ASP NET Cookies

