Django authentication works on Chrome, but not on Firefox

倖福魔咒の 提交于 2019-12-01 09:46:05

问题


I'm having a problem where Django's login is working okay on Chrome but not on Firefox: when trying to login to a restricted portion of the site on Firefox, it simply loops back again and again to the login page; furthermore, no error message appears on the log regarding that. Interestingly, the error doesn't happen when the server is on the local machine.

Does someone have a general idea of what could be causing that strange behavior?

I'm using Django 1.6 on Python 2.7


回答1:


this isn't much of an answer, but a linking to other similar problems. Because I don't have rep, all I can do is leave an answer.

A issue like this was encountered in 2012 but was never conclusively answered:
Django session doesn't work in Firefox

A similar question where the user could login via local server but not remote firefox was encoutered:
Unable log in to the django admin page with a valid username and password

The second was very well documented and had an accepted answer that was well liked.

Recommendations:

  1. If you are not using https make sure you have this setting SESSION_COOKIE_SECURE = False.
  2. If you are using a database backed, Check if the session is actually being created in the django_sessions table .
  3. If you are using a cached backed, check that SESSION_ENGINE is django.contrib.sessions.backends.cache and that CACHE_BACKEND is properly configured.


来源:https://stackoverflow.com/questions/24410058/django-authentication-works-on-chrome-but-not-on-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!