Transferring session from classic ASP to ASP.NET

antic

Perch
In case anyone else needs this info, I'm posting the link here. Very handy, and very obvious - one of those "why didn't I think of that" things.

http://www.eggheadcafe.com/articles/20041017.asp

Basically it goes like this:

1. Create an ASP page which spits out an XML representation of all the session vars you want to transfer,

2. Create an ASP.NET entry page which send an http request to the ASP page above, complete with browser cookie header string, which will include the "ASPSESSIONIDxxxx" string.

3. The classic ASP page interprets this call as a normal call from a browser, spits out the session info in XML, which the ASP.NET script pumps into the ASP.NET session collection.

Very elegant. Only needs to be done once, when going from a classic ASP page to .NET page. Can be secured so that the classic ASP page only outputs the data to the server's own IP address, not from outside requests, and/or it can look for a secret header or querystring value passed by the calling .NET code.

Just shows how valuable lateral thinking is. MVPs are valuable in other ways I'm sure. :)
 
Back
Top