Mvc2 areas and session

905 Views Asked by At

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

2

There are 2 best solutions below

2
On BEST ANSWER

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

2
On

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 difference, but TempData is a MVC mechanism so might have an extra hook in there.