【问题标题】:PostgreSQL (pgAdmin) and cross-site cookie warningsPostgreSQL (pgAdmin) 和跨站点 cookie 警告
【发布时间】: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_KEYPGADMIN_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


【解决方案1】:

我解决了升级到 pgAdmin 的最新版本(PostgreSQL 中包含的不是最后一个版本)并删除存储在缓存中的 cookie。

【讨论】:

    猜你喜欢
    • 2020-02-03
    • 1970-01-01
    • 1970-01-01
    • 2014-11-28
    • 2020-02-10
    • 2016-08-20
    • 2020-04-19
    • 1970-01-01
    • 2011-01-01
    相关资源
    最近更新 更多