简体   繁体   English

Django未在Internet Explorer中存储会话cookie

[英]Django not storing session cookie in Internet Explorer

To give some more context: We have an fb app which gets served under: 给出更多的背景信息:我们有一个fb应用程序,该应用程序可在以下环境中提供:
domain.com/fb/ domain.com/fb/
and we have the normal site which gets served under 我们有正常的网站
domain.com domain.com

Our fb app serves domain.com/fb/ in an iframe and is accesiable via: 我们的fb应用在iframe中提供domain.com/fb/,可通过以下方式访问:
apps.facebook.com/ourappname/ apps.facebook.com/ourappname/

I'm currently having an issue with only IE, which caused request.user to be an anonymous user, even when the user is logged in (Only in IE) everything works fine in all other browsers. 我目前只有IE出现问题,这导致request.user成为匿名用户,即使该用户登录(仅在IE中)也可以在所有其他浏览器中正常工作。 The reason for the request.user to be an anonymous is that the session cookie is not being set. request.user为匿名的原因是未设置会话cookie。 I verified this by inspecting the cookies in IE and also django-debug-toolbar showed me that. 我通过检查IE中的cookie验证了这一点,并且django-debug-toolbar也向我展示了这一点。

So how can I fix this issue? 那么,如何解决此问题?

The P3P headers are set: P3P标头已设置:

response['P3P'] = 'CP="IDC CURa ADMa OUR IND PHY ONL COM STA"'
return response

They are also added by apache itself so kind of double just wanted to make sure it worked. 它们也由apache本身添加,因此只是想确保它能起作用就加倍了。

It's known security behavior of IE with iframe web sites. 使用iframe网站的IE的已知安全行为。 This could help: Cookie blocked/not saved in IFRAME in Internet Explorer 这可能会有所帮助: Cookie被阻止/未保存在Internet Explorer的IFRAME中

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

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