I have 2 ASP.NET applications (i.e. WebApp1 and WebApp2).
Now in WebApp1 I create the session for the user (i.e. Session["user"] = "username") and read that session value in WebApp2 (string username = Convert.ToString(Session["user"]).
Now my question is will I able to read session value in WebApp2 for the below scenario?
1. I have hosted both the applications on same Application Pool on the same IIs server.
2. I have hosted both the applications on different Application Pool on the same IIS server.
3. I have hosted both the applications on different IIS server.
As per my understanding, I should able to read the session value in scenario 1 as Application Pool handle the InProc
session. But I am not able to read the session value in any of the above scenario.
If I use cookie, What will be your answer for all the above 3 scenarios?
Please help me by giving the answer of my above question.
Session is manager per-application (and really per-app domain). It doesn't matter if the two different app domains share the same app pool. The way to share the data across the apps is to use a database or write your own state server that allows sharing
data.
ayaz.shaikh1...
Member
1 Points
7 Posts
Maintain session across multiple application
May 07, 2012 09:24 AM|LINK
I have 2 ASP.NET applications (i.e. WebApp1 and WebApp2).
Now in WebApp1 I create the session for the user (i.e. Session["user"] = "username") and read that session value in WebApp2 (string username = Convert.ToString(Session["user"]).
Now my question is will I able to read session value in WebApp2 for the below scenario?
1. I have hosted both the applications on same Application Pool on the same IIs server.
2. I have hosted both the applications on different Application Pool on the same IIS server.
3. I have hosted both the applications on different IIS server.
As per my understanding, I should able to read the session value in scenario 1 as Application Pool handle the InProc
session. But I am not able to read the session value in any of the above scenario.
If I use cookie, What will be your answer for all the above 3 scenarios?
Please help me by giving the answer of my above question.
Thanks for your help in advance.
Thanks,
Ayaz Shaikh
roopeshreddy
All-Star
20135 Points
3323 Posts
Re: Maintain session across multiple application
May 07, 2012 09:28 AM|LINK
Hi,
Answer to question is Out of Process - SQL Server!!!
More over, you can also check the below forum post!
http://forums.asp.net/t/1411879.aspx/1
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
BrockAllen
All-Star
27434 Points
4891 Posts
MVP
Re: Maintain session across multiple application
May 07, 2012 01:31 PM|LINK
Session is manager per-application (and really per-app domain). It doesn't matter if the two different app domains share the same app pool. The way to share the data across the apps is to use a database or write your own state server that allows sharing data.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/