tags:

views:

56

answers:

3

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?

+2  A: 

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.

jball
well the worker process is part of IIS I believe.
CoffeeAddict
did not answer my question. I asked what process and what memory on the server.
CoffeeAddict
@CoffeeAddict - the answer to your question is the second sentence of my answer "By default it's in the worker process memory". In reference to your comment under Dustin's answer, each app pool has one worker process. If you look in your taskmanager, you'll see the allocations happening under w3wp.exe for IIS 7 app pools.
jball
A: 

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)

Onkelborg
+1  A: 

" 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

Dustin Hodges
yea this is what I assumed. The worker process / app pool. Each app pool has a worker process running I believe...but I need to verify that.
CoffeeAddict