I am trying to exchange sessions between two web applications hosted on the same server. One of them is a .net 2.0 application for web forms, the other is a .net 3.5 MVC2 application.
Both applications have their own session configured as follows:
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" />
In the webform application, I send the session key to the MVC application:
protected void LinkButton1_Click(object sender, EventArgs e) { Session["myvariable"] = "dan"; string sessionKey = HttpContext.Current.Session.SessionID;
Then I get it in an MVC application and try to use the same session as this:
[HttpPost] public void Recieve(string sessionKey ) { var manager = new SessionIDManager(); bool redirected; bool IsAdded; manager.SaveSessionID(HttpContext.ApplicationInstance.Context, Id, out redirected, out IsAdded); var myVar = Session["myvariable"]; }
The key is sent, but the session does not seem to be loaded into the MVC application, i.e. sessionKey is NULL. Can I try to do this?
Dan May 19 '10 at 18:37 2010-05-19 18:37
source share