Internet Explore 无法正确获取跨域 django web 服务会话 cookie
我的站点(站点A)是基于django的,我在站点A上编写了一个jsonp服务。我有另一个站点(站点B)调用该服务。
当我在站点 BI 上调用 jsonp 服务时遇到问题,发现站点 A 上的 request.user.is_authenticated 为 false,即使我已登录站点 A。
这在 Firefox 中似乎不是问题,显示 request.user.is_authenticated 为 true。
我怀疑这是有关获取跨域会话 cookie 的互联网探索错误中的一个错误。有人遇到类似的问题吗?或者您是如何解决这个问题的?
My site (site A) is based on django,and i wrote a jsonp service on site A. I have another site (site B) that call the service.
I am experiencing a problem when i call the jsonp service on site B I found that the request.user.is_authenticated is false on the site A, even though I have logged into site A.
This doesn't appear to be a problem in firefox, which shows request.user.is_authenticated as true.
I suspect that this is a bug in internet explore bug regarding getting cross domain session cookies. Does any one have similar problem or how did you work around it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有点困惑。如果您登录到站点 A,并不一定意味着您也登录到站点 B。或者您是否实现了它,以便在浏览器中存储一个特殊的 cookie 来充当登录令牌?
无论如何,我觉得这总体上是糟糕的设计。系统中不应有 2 个控制器。如果您确实坚持保留站点 B,则可以通过使用站点 A 作为与站点 B 通信的中介机制来解决此问题。这样,您就根本不必处理浏览器不兼容的问题。
如果您想要一个中央登录系统,请使用 facebook connect 或等效的社交媒体工具。
I'm a little confused. If you are logged into Site A, it doesn't necessarily mean you're also logged into site B. Or did you implement it such that you store a special cookie in browser that acts as a login token?
Anyway, I feel this is poor design in general. You shouldn't have 2 controllers in a system. If you really insist to keep a site B, you could solve this by using site A as an intermediary mechanism to communicate with site B. That way, you won't have to deal with browser incompatibilities at all.
If you want a central login system, use facebook connect or an equivalent social media tool.