我正在使用 python 3.7.4、django 3.0.6、javascript、Postgres 12.3.1。当我的页面在控制台上加载时,会出现以下警告:
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/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/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/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
它们应该来自new policy about cookies .问题是 PGADMIN_KEY
和 PGADMIN_LANGUAGE
是 PGAdmin (PostgreSQL) 的 cookie,我没有明确使用它们(我的意思是显然数据库本身使用它们但在我的代码中它们不'出现)那么我该如何解决这个问题呢?
- 这是 PGAdmin 的一个错误,我所能做的就是等待修复此错误的新版本的 PGAdmin?
- 我应该在我的代码中(在哪里???)使用
SameSite=none 显式声明它们;安全
参数? - 其他?
感谢您的帮助。
附言
我做了另一个相关的问题,有人在删除的评论中(叹气,请不要删除评论)说像 /localhost/
被认为与 /127.0.0.1:8000 不同/
。不知道能不能帮到我
最佳答案
我解决了升级到最新版本的 pgAdmin(PostgreSQL 中包含的不是最后一个)并删除存储在缓存中的 cookie。
关于javascript - PostgreSQL (pgAdmin) 和跨站点 cookie 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62896516/