12 February 2016

Session sharing between Classic ASP and ASP.NET

Recently for a project which was a mix of classic ASP and ASP.NET, I was exploring ways of sharing session between classic ASP and ASP.NET.

After a bit of research, I found following three ways -

Option 1
  • Use nSession DLL - http://nsession.codeplex.com/
  • This provides a library which can be used in both ASP.NET and classic ASP applications to access session values. 
Option 2
Option 3
  • From ASP.NET page, encrypt session and pass in query string or store in a cookie.
  • Redirect to classic ASP page.
  • Get the encrypted value from query string or cookie, decrypt it and store in classic ASP session.
  • This new session can be used in application.
We have followed 'Option-2' which is standard recommended approach by Microsoft and is also a safer option with respect to security.

1 comment:

Unknown said...

Hi, Mayank
Do you have working sample for Option 2 ?
Because actually I'm trying to implement it, but did not works at my place.

Thanks