Last post Jul 27, 2011 11:11 AM by GPankaj
Jul 26, 2011 01:34 AM|kooboobird|LINK
I have two IIS server. They are on different PCs.
PC A's IIS run WebSite A;
PC B's IIS run WebSite B;
And the two WebSites' Session are stored in StateServer.
There is only one StateServer, and the StateServer is on PC A.
Is there a way to let WebSite B to access WebSite A's Session?
Any tips will be appreciated! Thanks in advance.
Jul 26, 2011 02:12 AM|thankikaushik|LINK
not at all u cant , think about it if u can do this what about the security? it really might not possible but it can be possible
the following way
storing session data in a SQL Server database. It is the most reliable option but the least performing one.
Jul 26, 2011 02:14 AM|manishgvsharma2000|LINK
See this thread
Jul 26, 2011 09:22 PM|kooboobird|LINK
Thank you all.
I've tried the solutions provided by the link. But I found that they are all about DB Session State.
Is there some solution about StateServer?
I know that the question is curious, but it do make sense to our project.
If there isn't any solution, maybe we have to turn to other direction.
Jul 27, 2011 03:25 AM|kooboobird|LINK
I found a solution by googling.
What follows are detail:
"System.Web.SessionState.OutOfProcSessionStateStore" class has a static private filed "s_uribase",
using reflection we can set the filed as same value for every website, which should share session.
We can define a class which implement the IHttpModule, then we can do the above reflection in the IHttpModule.Init method.
beyond that, we should set the "machineKey" as the same value for every website in the web.config.
the solution is in a Chinese blog:
There has full version code.
But this isn't a perfect solution, when the WebSite A and WebSite B are on the same PC, the same IIS, it worked.
But when they are on different PC, it doesn't work.
Dose anyone know why it works?
And why it doesn't work when the websites are on different PCs?
Should I change other fileds by reflection to make it work?
Jul 27, 2011 11:11 AM|GPankaj|LINK
Did you try this link.
This lik is provided in one of the above post.