开发者

Django sessions not working in Internet Explorer

开发者 https://www.devze.com 2023-02-05 02:25 出处:网络
Sessions work perfectly in all other browsers that I have tested. If I try to get the session id with sessionid = req开发者_运维知识库uest.COOKIES[\'sessionid\'], I get this error: KeyError: \'sessio

Sessions work perfectly in all other browsers that I have tested.

If I try to get the session id with sessionid = req开发者_运维知识库uest.COOKIES['sessionid'], I get this error: KeyError: 'sessionid'

This is what I have in my settings.py:

CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
SESSION_COOKIE_DOMAIN = '.vb.is'
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

Sites are vb.is, fiskifrettir.vb.is and hestabladid.vb.is

Django sessions not working in Internet Explorer

Server setup is: apache2 (mod_wsgi) and nginx


Setting a cookie on XX.XX won't work in general. See Q#6 here: http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx and see http://blogs.msdn.com/b/ieinternals/archive/2009/09/19/private-domain-names-and-public-suffixes-in-internet-explorer.aspx.

You can avoid the problem by setting the cookie with domain=WWW.vb.is instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消