Question

I want my asp.net mvc(C#) application to be with the session without expire.

The Session should be active forever the user opens the application.

Whats the best way to do it?

Was it helpful?

Solution

I know two possibilities. First, set the session timeout in web.config to very long time interval. Second, set the timeout to moderate interval like 10 or 20 minutes and include the ajax call to some method on server that does nothing. And make that call every, say 3-5 minutes, like some sort of keep-alive call. The downside is that you should have this javascript on every page so it will be better to put in on the master page

OTHER TIPS

You might want to have a look at this for a possible solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top