【发布时间】:2020-08-06 05:56:40
【问题描述】:
我正在使用 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 的一个 bug,我能做的就是等待新版本的 PGAdmin 修复这个 bug?
- 我应该使用
SameSite=none; Secure参数在我的代码中显式声明它们(在哪里???)? - 其他?
感谢您的帮助。
PS
我做了另一个相关的问题,有人在已删除的评论中(叹气,请不要删除 cmets)说像 /localhost/ 这样的东西与 /127.0.0.1:8000/ 不同。不知道能不能帮到我
【问题讨论】:
-
cookie 名称不言自明。它们来自 pgAdmin 程序,我认为这是您在收到消息时正在运行的程序。 pgAdmin 是第三方应用程序,不是 Postgres。这些 cookie 不是来自 Postgres。
-
啊,好的,谢谢你的澄清。我认为它们是同一回事(我不专业)。但问题依然存在。这是一个pgadmin错误?所以我应该等待一个新版本?
-
我不知道。您可以在这里提出问题:redmine.postgresql.org/projects/pgadmin4/issues。您需要注册一个社区帐户才能这样做。
标签: javascript python django cookies pgadmin