我的控制台中针对跨站点 cookie 的这些警告是什么?

What are these warning for cross-site cookie in my console?

我在 windows 7 上使用 python 3.7.4、django 3.06、javascript 和 jquery。

我不确定它什么时候发生,但现在我的控制台(firefox 上的 F12)给了我这些警告:

Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/lists/list-name/” because the scheme does not match. list-name
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/lists/list-name/” because the scheme does not match. list-name
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/lists/list-name/” because the scheme does not match. list-name
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/lists/list-name/” because the scheme does not match. list-name
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/js/common.js” because the scheme does not match. common.js
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/js/common.js” because the scheme does not match. common.js
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/lists/js/lists.js” because the scheme does not match. lists.js
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/lists/js/lists.js” because the scheme does not match. lists.js
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/jsi18n/” because the scheme does not match. jsi18n
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/jsi18n/” because the scheme does not match. jsi18n
Cookie “PGADMIN_KEY” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/icons/favicon.png” because the scheme does not match. favicon.png
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/icons/favicon.png” because the scheme does not match. favicon.png

我正在测试我的代码,我对其进行了一些更改,但与 cookie 或管理无关,而且我的网站对 cookie 的使用非常有限。 PGADMIN_KEYPGADMIN_LANGUAGE 看起来像 django 管理 cookie,我没有碰过它们。 jsi18n 是 django 的翻译模块:不是我的代码,我照原样使用。

这几天没升级了

我不知道你需要什么代码来帮助我。

我在我的模板中使用它(我看到 jquery.cookie 没有更新,但即使 js.cookie.min.js 也出现同样的问题):

<script type='text/javascript' src=' http://cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js '></script>
<script type='text/javascript' src="{% static '/js/common.js' %}"></script>
<link rel='icon' type='image/png' href="{% static 'icons/favicon.png' %}">

对于 cookie 也是这样:

var csrftoken = $.cookie('csrftoken');
function csrfSafeMethod(method) {
    // these HTTP methods do not require CSRF protection
    return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}
$.ajaxSetup({
    beforeSend: function(xhr, settings) {
        if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
            xhr.setRequestHeader('X-CSRFToken', csrftoken);
        };
    }
});

如已删除评论中所述,警告应来自 new policy about cookies。 cookie 来自 pgAdmin,包含在 PostgreSQL 中。

我解决了升级到最新版本的 pgAdmin 并删除缓存中存储的 cookie 的问题。

类似的错误,但没有 python 和 django ,已通过清除 cookie(firefox | 开发者工具 | 存储 | cookies...)并刷新页面解决。