简体   繁体   English

具有传统ASP的Web场中的会话共享

[英]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. 我们处于负载均衡的环境中,负载均衡器是www.domain.com,我们有4台服务器使用SQLServer会话进行负载均衡,用于.NET ... www1,www2等。

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. 问题是我们还有一些遗留的ASP内容,一旦我们在负载均衡器上关闭Sticky IP,我们就需要继续工作。 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. 所以我们的想法是在需要ASP的少数地方,我们会将用户粘贴到登录决定的特定服务器上。

For example. 例如。

1) User logs into .NET site 1)用户登录.NET站点
2) .NET site finds out what server processed the login request, and write ASP authentication to that server. 2).NET站点找出哪个服务器处理了登录请求,并将ASP身份验证写入该服务器。
3) Server name is stored in variable 3)服务器名称存储在变量中
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. 4)任何时候用户访问ASP,我们使用服务器名称变量来确保他/她最终在具有他/她的身份验证和会话的服务器上。

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. 问题在于,由于实际的登录请求仅仅是负载均衡器,因此当我们将用户引导至www3.domain.com/blah.asp时,会话不在,因为它与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. 您可以将“domain.com”而不是“www.domain.com”用作会话cookie的域名 ,因此可以从www1.domain.com,www2.domain.com等处读取cookie。

On the web.config : 在web.config上:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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