views:

650

answers:

5

This seems trivial, but I've never had to worry about it before and my Google skills are failing me. How far-reaching is the in-process session bucket for ASP.NET/IIS6, in the sense that you can call Session["whatever"] and get the same value back? Obviously it can't stretch across different servers or application pools (I think). What about different web sites in the same application pool? Can those two see each other's session variables for a user? What about two different virtual directories each with their own web.config?

Thanks!

+1  A: 

Obviously it can't stretch across different servers

Sure you can. This MSDN Article has more details.

Tom Ritter
Ah, yeah, just meant InProc, not via SQL or a stateserver :)
Chris
A: 

It can stretch across servers in a farm if the asp.net session is stored in the database.

Perimeter of session is strictly within the one app domain for security reasons

dove
A: 

This sounds like you would be better off storing a database value than storing it in a In-Proc session[""]. If you have a state server then the session can be accessed across all machines that use the same state server. In-Proc is just what it says. It's stored In the Process of that single computer.

Arron
Process, yes, but how far does that go? Each app pool has its own w3wp.exe process (web gardens notwithstanding), but can different logical apps within the same process/pool see each other's session states?
Chris
A: 

If you wanted to share Session across applications with a SQL Server backend, there's an article on how to do that.

jwmiller5
+2  A: 

AFAIK the in-process session has an AppDomain scope, so no, two web applications running in the same pool cannot share an in-process session. Actually the name "in-AppDomain" would be more appropriate.

csgero