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

Javascript 对于我的控制台中的跨站点cookie,这些警告是什么?,javascript,django,cookies,warnings,cross-site,Javascript,Django,Cookies,Warnings,Cross Site,我在Windows7上使用Python3.7.4、Django3.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-nam

我在Windows7上使用Python3.7.4、Django3.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
​我正在测试我的代码,我对它做了一些更改,但与cookies或admin无关,我的站点对cookies的使用非常有限
PGADMIN_键
PGADMIN_语言
看起来像django admin cookies,我没有碰它们
jsi18n
是django的传输模块:不是我的代码,我照原样接受它

我这几天没有升级过

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

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


正如删除的评论中所说,这些警告应该来自于。cookies来自PostgreSQL中包含的pgAdmin


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

类似的错误,但没有python或django,通过清除cookies(firefox |开发工具|存储| cookies…)得到了解决和刷新页面。

我还强烈建议您加载a)新的jQuery,b)加载它HTTPS@mplungjan我做了你建议的改变,我读了同样的文章,但解决方案还不清楚。cookies pgadmin_键和pgadmin_语言来自我的数据库postgresql,我没有明确设置它们,所以这应该由postgres开发人员解决,对吗?(问题或答案下的评论大多会被删除,以响应用户升起的标志。在某些情况下,如果评论符合一些无关紧要的标准(例如,它们主要是感谢),则可以自动删除用户升起的标志上的评论)。
<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' %}">
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);
        };
    }
});