java - 从 nginx 代理到 Chrome 中的 java 应用程序时缺少 cookie
问题描述
在我们的 java 应用程序中,我们刚刚通过 x509 证书设置了身份验证。
它工作正常,只有一个例外是,当使用 nginx 代理应用程序和使用 Chrome 的用户时,注销 cookie 丢失。在 Mozilla FF cookie 中按预期设置
这是 FF 中的 cookie 在请求 /sd 时的样子
这就是这些在 Chrome 中的样子
如您所见,Chrome 中缺少 x509 cookie
如果我们使用 IIS 或根本不使用代理(仅 Tomcat),则两种浏览器的行为都是相同的。
这就是我设置cookie的方式:
public static Cookie getCookie(String value, int maxAge)
{
Cookie cookie = new Cookie(X509ConfigProperties.COOKIE, value);
cookie.setMaxAge(maxAge);
cookie.setPath("/");
return cookie;
}
也许我们只需要异常配置nginx config?
解决方案
推荐阅读
- seaborn - 如何摆脱 Seaborn 热图中的 x-ticks 和轴之间的空间?
- r - 如何从 csv 输入列在传单中创建工作超链接?
- mysql - 复合主键的重复值
- cmd - 使用 cmd 操作名称中包含逗号的文件夹
- javascript - 如何创建自己的“项目另存为”以将所有文件保存在 React.js 中?
- python - 使用 Keras 的 CNN 的输出形状和参数
- android - Android Studio Windows 脚本:未找到 gradlew 命令
- c# - Rijndael 和 CryptoJs 互操作性
- reactjs - ReduxToolkit:如何将存储更改同步到本地状态?
- mysql - MYSQL:组合两个不同的表并计算一列的 SUM 和 GROUP BY 两列