分享

登陆启用cookie问题

yang123jin4 发表于 2015-8-11 23:42:44 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 5 14370
浏览器登陆时显示   你的浏览器好象不允许使用cookie。登录需要使用启用cookie。
但是我Internet属性中cookie已经调到最低了,为什么还是不行

已有(5)人评论

跳转到指定楼层
bob007 发表于 2015-8-12 07:27:28
怎么不行了,描述清晰,上图
回复

使用道具 举报

yang123jin4 发表于 2015-8-12 22:37:57
bob007 发表于 2015-8-12 07:27
怎么不行了,描述清晰,上图

原来是浏览器cookie满了,清一清就OK,不过进去后又显示这个:
Forbidden (403)CSRF verification failed. Request aborted.

HelpReason given for failure:
    CSRF cookie not set.    In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django's CSRF mechanism has not been used correctly. For POST forms, you need to ensure:
  • Your browser is accepting cookies.
  • The view function uses RequestContext for the template, instead of Context.
  • In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.
  • If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data.
You're seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.
You can customize this page using the CSRF_FAILURE_VIEW setting.

这个该怎么解决啊


回复

使用道具 举报

yang123jin4 发表于 2015-8-13 12:22:24
浏览器清了下kookie又能进去了,但是又显示这个了:
Forbidden (403)
CSRF verification failed. Request aborted.

Help
Reason given for failure:

    CSRF cookie not set.
    In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django's CSRF mechanism has not been used correctly. For POST forms, you need to ensure:

Your browser is accepting cookies.
The view function uses RequestContext for the template, instead of Context.
In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL.
If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data.
You're seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed.

You can customize this page using the CSRF_FAILURE_VIEW setting.
回复

使用道具 举报

arsenduan 发表于 2015-8-13 14:49:17
yang123jin4 发表于 2015-8-13 12:22
浏览器清了下kookie又能进去了,但是又显示这个了:
Forbidden (403)
CSRF verification failed. Request ...

多刷新几次,确保用户名密码是正确的
回复

使用道具 举报

fay625 发表于 2015-9-3 22:01:57
arsenduan 发表于 2015-8-13 14:49
多刷新几次,确保用户名密码是正确的

我也遇到了 这种错误果真是多刷几次进去啦  好厉害啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条