分享会话状态跨多个域的.NET(不是子网域) [英] Share Session State Across Multiple Domains in .net ( NOT SUB Domains )

查看:188
本文介绍了分享会话状态跨多个域的.NET(不是子网域)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用与会话状态存储在SQL Server数据库SQL Server中使用ASP.net3.5瓦特/ C#。

I am using ASP.net 3.5 w/ C# using SQL Server with Session State stored in the SQL Server DB.

我有一个问题与跨多个域丢失会话状态,但使用相同的浏览器实例,并同code基地。

I have an issue with losing session state across multiple domains, but using the same browser instance and same code base.

例如,我们正在指导客户的 www.MyStore.com 以浏览我们的商店,我们希望给客户的 www.MyStore.ShopPlatform.com 发送到结账W /安全SSL验证。会话正在重新创建时重新定向为 www.MyStore.ShopPlatform.com

For example, We are directing customers to www.MyStore.com to browse our store and we want to send customers to www.MyStore.ShopPlatform.com to checkout w/ secure SSL validation. The session is being re-created when re-directed to www.MyStore.ShopPlatform.com.

通配符SSL安装在www.ShopPlatform.com。

The wildcard SSL is installed at www.ShopPlatform.com.

所以,现在的问题是....你怎么1会话状态的cookie多个域(相关联 www.MyStore.com www.MyStore.ShopPlatform.com )在同一服务器上使用.NET?

So, The question is.... How do you associate 1 session state cookie to multiple domains (www.MyStore.com and www.MyStore.ShopPlatform.com) on the same server using .net?

推荐答案

如果您使用Cookie的会话,你不知道。浏览器将不发送cookie来不匹配域,你不能为所有域的cookie。即使你能,会话cookie仅仅是服务器端会话密钥并没有访问会话商店,关键并不意味着什么。第三方不会有。

If you use cookies for session, you don't. The browser won't send cookies to domains that don't match, and you can't set a cookie for all domains. Even if you could, the session cookie is just a key to server-side session and that key doesn't mean anything without access to the session store. A third party won't have that.

如果www.mystore.com和www.mystore.shopplatform.com碰巧都是由你自己的机器进行备份,并且两个机器可以访问相同的会话存储,那么你可能能够使用无Cookie ASP.NET会话配置,使其工作。

If www.mystore.com and www.mystore.shopplatform.com happen to both be backed by machines you own, and both machines have access to the same session store, then you might be able to use a Cookieless ASP.NET Session config to make it work.

一般来说,你不能使用会话这种方式。

Generally speaking, you can't use session this way.

这篇关于分享会话状态跨多个域的.NET(不是子网域)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆