简体   繁体   中英

Session sharing in a web farm with classic ASP

We are in a load-balanced environment, the load balancer is www.domain.com, and we have 4 servers that are load balanced using SQLServer sessions for .NET...www1, www2, etc.

The problem is that we also have some legacy ASP stuff that we need to continue to work once we turn Sticky IPs off on the load balancer. So our idea was in the few places where ASP was needed, we would stick the user to a specific server that was decided on login.

For example.

1) User logs into .NET site
2) .NET site finds out what server processed the login request, and write ASP authentication to that server.
3) Server name is stored in variable
4) Anytime user accesses ASP, we use the server name variable to ensure that he/she ends up on the server that has his/her authentication and session.

The issue is that since the actual login request is simply to the load balancer, the session is not around when we direct user to www3.domain.com/blah.asp because it is a different domain than www.domain.com.

So I think we're looking at some way to share sessions across domains, but with a little twist, I guess.

Any help is appreciated, and I hope I conveyed the problem clearly.

You can use as the domain of your session cookie the 'domain.com' and not the 'www.domain.com' , so the cookie can be read from www1.domain.com, www2.domain.com etc.

On the web.config :

<authentication mode="Forms">
  <forms path="/" domain="domain.com" ..... />
</authentication>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM