Django csrf_token在Internet Explorer 11中不起作用

时间:2016-07-14 11:06:40

标签: django security internet-explorer-11 django-csrf

我有一个非常简单的登录表单,里面有csrf令牌。 当我提交此表单时,所有数据都会正确发送:

csrfmiddlewaretoken=GTAf5G5Pg4QsP2IMe02WqWkv1oX6NuqK&login=admin&password=admin

有令牌,登录名和密码。

<form action="/login_sent" method="post">
    <div class="modal-body clear-fix">
        {% csrf_token %} 
        <label for="login-input">User Name</label>
        <div class="input">
            <input id="login-input" type="text" name="login" placeholder="Enter login">
        </div>
        <label for="password-input">Password</label>
        <div class="input">
            <input id="password-input" type="password"  name="password" placeholder="Password">
        </div>  
    </div>
    <div class="modal-footer">
        <button type="submit" class="btn btn-primary pull-right">
            Sign In
        </button>
    </div>
</form>

在Chrome和Firefox上一切正常,但在Internet Explorer 11上我收到此错误:

Forbidden (403)

CSRF verification failed. Request aborted.

我检查了日志,但没有更多的东西。 我在这里发现了类似的问题:CSRF verfication failed, but only with IE9 但这些解决方案对我不起作用。

如何解决此问题的任何想法(不禁用csrf令牌)?

0 个答案:

没有答案