简体   繁体   English

在不同域和不同应用程序(经典 ASP 和 ASP.NET)之间共享 cookie

[英]Sharing cookies across different domains and different applications (classic ASP and ASP.NET)

有没有办法在不同的域和不同的应用程序(经典的 ASP 和 ASP.NET)之间共享 cookie

No, there isn't.不,没有。

The issue is the cross domain one, rather than the asp.net/classic asp and is security reasons.问题是跨域问题,而不是 asp.net/classic asp 并且是安全原因。

If the domains are subdomains you can share the cookies, provided you use a cookie path that both can access (ie. for the domain sub.example.com you can read and write cookies using the example.com domain).如果域是子域,您可以共享 cookie,前提是您使用两者都可以访问的 cookie 路径(即,对于域sub.example.com您可以使用example.com域读取和写入 cookie)。

You can share cookies via some behind the scenes communication between servers, or through querystrings.您可以通过服务器之间的一些幕后通信或通过查询字符串共享 cookie。

Both are ill advised, unless the information in the cookies is harmless (but be aware that harmless looking data quite often isn't actually harmless).两者都是不明智的,除非 cookie 中的信息是无害的(但请注意,看似无害的数据通常实际上并非无害)。

Native support for accessing cookies is not possible cross domain, and probably will never be for security reasons.对访问 cookie 的本机支持不可能跨域,并且可能永远不会出于安全原因。

您可以使用 cookie 转换器将所有 cookie 保存在共享数据库中并尝试重新创建它们。

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

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