Transferring Sessions between ASP and

As you will find out by doing some quick googling, there is no automatic way to transfer a session between ASP and Some have suggested that you should load the session variables in a database while in the ASP (or portion of the site and retrieve them into a fresh Session object when you are on the (or ASP) portion of the site.

Here is something that looks like a better idea. In this article on EggHead Cafe Peter Bromberg describes a different method that covers four pages, 2 ASP and 2

  1. Load a Session Object in ASP
  2. Server.Transfer to an ASP page. On this page retrieve each entry in the Session object into a hidden form field. Include one hidden field that contains the final destination aspx page. Automatically post this field to a receiver page.
  3. receiver page. In Page_Load scan the Request.Form object, insert each posted entry to the (new) Session object. Server.Transfer to the destination page (listed in one of the posted fields)
  4. Destination page. You now have an session object that contains all of the appropriate entries for this user

The same procedure can also be reversed to transfer back from to ASP. Sample files can be downloaded here.

Doesn’t look too complicated. I think I may give it a try.

Tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *