PositiveGuy
PositiveGuy

Reputation: 47783

Session State (Server-side)

Ok I'm sure this is pretty obvious. But when you say session state is persisted on the "server" in memory, are we talking about IIS or what? When I think of Server-side session State, I think memory in terms of IIS app pools and such. Am I off base or missing anything here?

http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx

the term "server" could mean many things. Sure it's "server-side" but what specific process / memory / area / app on the server are we talking about (IIS only? other?)

I wish MS would have explained what they mean because that's pretty relative.

Specifically this, "store on server"

Storing Data on the Server (in memory)

• Session state
• Application state
• Profile Properties

so "on the server" where in memory and what process/app is handling each of these?

Upvotes: 0

Views: 1955

Answers (3)

Dustin Hodges
Dustin Hodges

Reputation: 4193

" Sure it's "server-side" but what specific process / memory / area / app on the server are we talking about (IIS only? other?)"

Each site runs in an application pool and each application pool is basically a process on your web server. If your session is configured to be in process, your session objects will be stored in that process' memory

Upvotes: 4

Onkelborg
Onkelborg

Reputation: 4007

ASP.NET is just a framework; it's a collection of classes, and they execute code. It's this code that provides you with session state, and it stores the information about your session state in some objects, just like a dictionary or similar.

(When doing In Proc, then you have state server, sql server, and custom, where custom can be anything as long as someone has written some code implementing the right interfaces)

Upvotes: 0

jball
jball

Reputation: 25024

It depends. By default it's in the worker process memory, but it can be on a dedicated state server or in SQL or your own custom provider.


From MSDN:

ASP.NET session state supports several different storage options for session data. Each option is identified by a value in the SessionStateMode enumeration. The following list describes the available session state modes:

  • InProc mode, which stores session state in memory on the Web server. This is the default.

  • StateServer mode, which stores session state in a separate process called the ASP.NET state service. This 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.

  • SQLServer mode stores session state in a SQL Server database. This 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.

  • Custom mode, which enables you to specify a custom storage provider.

  • Off mode, which disables session state.

Upvotes: 4

Related Questions