Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default sessionState in an asp.net mvc 3 application?

I was considering using <sessionState mode="InProc" timeout="45" /> because some users are repeatedly logging in, and I would like to save them some time. However, before I add this to my web.config file, I wanted to make sure there would be no side affects.

I read up on sessionState versions, although I already am fairly aware of what goes on, I was curious to know what the default setting for an asp.net mvc 3 application was as there is no defined sessionState inside of my system.web at this time.

I know that the application has access to Session["key"] without the declaration, although I try to avoid putting that type of load on the Session. I would assume that there is a setting in IIS 7 which my application is inheriting (This application is on a shared hosting environment).

I understand that there could be issues if I was using a dedicated database or server for the Session, but this is just a basic setup as far as that goes, nothing fancy.

Is there a default sessionState for asp.net mvc 3? Is it just being inherited? Will there be side affects from overriding it in my web.config if it is defined elsewhere in IIS?

like image 658
Travis J Avatar asked Jan 16 '13 18:01

Travis J


People also ask

What is sessionState in Web config?

config or Web. config configuration file identified by the sessionState tag. When a new client begins interacting with a Web application, a session ID is issued and associated with all the subsequent requests from the same client during the time that the session is valid.

Are sessions enabled by default in MVC?

By default, Asp.Net MVC support session state.

What is sessionState mode?

Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm. Objects stored in session state must be serializable if the mode is SQL Server.


1 Answers

As of now the default Timeout = 20 minutes.

These are the default values for .Net Framework 4. I think they don't change because of MVC 3.

like image 135
Anderson Pimentel Avatar answered Sep 19 '22 00:09

Anderson Pimentel