0
votes

We have a legacy application that is a mixture of Classic Asp and ASP.NET. This legacy app is in a sub folder of our main ASP.NET web site. To be clear in this sub folder there is a mixture of .asp and .aspx pages.

We don't share session but when navigating to an .aspx page from .asp we post enough information in the body to setup session in ASP.NET.

If the user navigates back to the .asp page then the users session is still there and everything works as normal on a single web server.

We are testing load balancing on two web servers, the setup is as follows.

The main ASP.NET uses no affinity, so it's up to the load balancer to decide which web server to use. The legacy app is in a sub folder, this sub folder has single affinity. Both web servers have the same machine key setup in the web.config. Session state for the ASP.NET application is stored in the database.

The issue is that the Classic Asp session is lost when navigating back to .asp from .aspx. I would like to understand why?

Note. Single affinity - sticky sessions is working for the legacy folder, I've checked this using the IIS logs. So all requests to the legacy folder will always be routed to the same web server.

1

1 Answers

0
votes

Classic ASP doesn't support sessions across servers in a load-balanced scenario. Using ASP.NET terminology (loosely), the only modes supported by ASP Clasic sessions are InProc and Off.

If you want session to work in a load balanced scenario you either have to configure your load balancer to use "sticky sessions/affinity", or roll your own custom session management backed by a database or something else (which is tricky to get right without creating security vulnerabilities).

Reading material: http://msdn.microsoft.com/en-us/library/ms972338.aspx