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

时间:2021-03-15 01:38:08

Is there a way to share cookies across different domains and different applications (classic ASP and ASP.NET)

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

3 个解决方案

#1


20  

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)。

#2


5  

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的原生支持是不可能的,并且可能永远不会出于安全原因。

#3


-4  

you can use cookie convertor which save all the cookies in the share database and try to recreate them again.

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

#1


20  

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)。

#2


5  

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的原生支持是不可能的,并且可能永远不会出于安全原因。

#3


-4  

you can use cookie convertor which save all the cookies in the share database and try to recreate them again.

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