admin管理员组文章数量:1310480
I'm using python 3.7.4, django 3.06, javascript and jquery on windows 7.
I'm not sure when it happens but now my console (F12 on firefox) gives me these warning:
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/mon.js” because the scheme does not match. mon.js
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/js/mon.js” because the scheme does not match. mon.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
I was testing my code, I made some change to it but nothing related to cookies or admin and my site has a very limited use for cookies. PGADMIN_KEY
and PGADMIN_LANGUAGE
look like django admin cookies and I haven't touched them. jsi18n
is the traslation module for django: not my code, I took it like it was.
I haven't done upgrades in these days.
I don't know what code you can need to help me.
I use this in my template (I see jquery.cookie
is not more updated but even js.cookie.min.js
gives the same problem):
<script type='text/javascript' src=' .cookie/1.4.1/jquery.cookie.min.js '></script>
<script type='text/javascript' src="{% static '/js/mon.js' %}"></script>
<link rel='icon' type='image/png' href="{% static 'icons/favicon.png' %}">
also this for cookies:
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);
};
}
});
I'm using python 3.7.4, django 3.06, javascript and jquery on windows 7.
I'm not sure when it happens but now my console (F12 on firefox) gives me these warning:
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/mon.js” because the scheme does not match. mon.js
Cookie “PGADMIN_LANGUAGE” will be soon treated as cross-site cookie against “http://127.0.0.1:8000/static/js/mon.js” because the scheme does not match. mon.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
I was testing my code, I made some change to it but nothing related to cookies or admin and my site has a very limited use for cookies. PGADMIN_KEY
and PGADMIN_LANGUAGE
look like django admin cookies and I haven't touched them. jsi18n
is the traslation module for django: not my code, I took it like it was.
I haven't done upgrades in these days.
I don't know what code you can need to help me.
I use this in my template (I see jquery.cookie
is not more updated but even js.cookie.min.js
gives the same problem):
<script type='text/javascript' src=' http://cdn.jsdelivr/jquery.cookie/1.4.1/jquery.cookie.min.js '></script>
<script type='text/javascript' src="{% static '/js/mon.js' %}"></script>
<link rel='icon' type='image/png' href="{% static 'icons/favicon.png' %}">
also this for cookies:
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);
};
}
});
Share
Improve this question
asked Jul 10, 2020 at 10:05
fabiofabio
1,3652 gold badges29 silver badges58 bronze badges
2
- 1 I also strongly suggest you load a) a newer jQuery and b) load it over HTTPS – mplungjan Commented Jul 10, 2020 at 10:14
- @mplungjan I made the changes you suggest and I read same articles but the solution isn't clear yet. The cookies pgadmin_key and pgadmin_language e from my database postgresql and I didnt set them explicitly so it's something that should be resolved by postgres developers, right? – fabio Commented Jul 12, 2020 at 19:00
2 Answers
Reset to default 4similar error, but without python nor django , was solved by clearing the cookies (firefox | developper tools | Storage | cookies...) and refreshing the page.
The warnings, like said in a deleted ment, should e from the new policy about cookies. The cookies es from pgAdmin, included in PostgreSQL.
I solved upgrading to the last version of pgAdmin AND deleting the cookies stored in the cache.
本文标签: javascriptWhat are these warning for crosssite cookie in my consoleStack Overflow
版权声明:本文标题:javascript - What are these warning for cross-site cookie in my console? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741825439a2399612.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论