【问题标题】:How to convert a non-secure cookie into a secure one如何将非安全 cookie 转换为安全 cookie
【发布时间】:2013-01-27 00:24:40
【问题描述】:

我有以下情况:如果我使用 HTTPs 访问我的 Web 应用程序,tomcat 会创建一个安全的 JSESSIONID cookie - 这是正常的,所以到目前为止没有任何问题。

如果我访问http然后tomcat会创建一个不安全的JSESSIONID cookie,这也是正常的。

我的问题是,当我使用 HTTP 访问我的 Web 应用程序时,会创建 cookie,然后 Spring Security (security:intercept-url pattern="/login.action" requires-channel="https"/>) 发送我到一个 HTTPs 连接。问题是 cookie 仍然不安全。

你知道有什么方法可以解决这个问题吗?有没有办法使用 Spring Security 重新创建 cookie?

任何帮助将不胜感激!

问候, 用户1532449

【问题讨论】:

    标签: tomcat https spring-security jsessionid


    【解决方案1】:

    使用 httpOnly 和 secure=true 保护 Tomcat 中的会话 cookie

    https://geekflare.com/secure-cookie-flag-in-tomcat/

    【讨论】:

    • 引用的文章不再可用
    猜你喜欢
    • 2019-10-27
    • 1970-01-01
    • 1970-01-01
    • 2013-01-19
    • 2020-05-28
    • 2012-02-09
    • 1970-01-01
    • 2012-01-22
    相关资源
    最近更新 更多