views:

91

answers:

2

Do Areas in Mvc2 have session isolation or do they share the same session as the rest of the application for the same user.

+1  A: 

They are part of the same ASP.NET application and therefore they share the same session.

Cheers,
Charles

Charlino
Well I dont seem to find that true as my request for the same session set in different area of mvc comes as null, where as in that area it works fine
Can you elaborate in your question please. Give us some code and some knowledge about how the application is setup in visual studio and IIS. Ta.
Charlino
A: 

Well I dont seem to find that true as my request for the same session set in different area of mvc comes as null, where as in that area it works fine

But they do, just like @Charlino said, it uses ASP.NET's session. Maybe you don't have just areas, but have actually separate virtual directories/applications.

Are you using Session[], or TempData[]. I don't think it makes a different, but TempData is a MVC mechanism so might have an extra hook in there.

eglasius
Well its simple I have a session in an area where i do this Session[SessionName]=something works fine but in main app i set this session variable to null by saying the samething but = null, and here on the application crashes with debugger showing null=null, even at the watch it shows null.
eglasius

related questions