【问题标题】:how to remove jsessionid in the url (Java)?如何删除 url (Java) 中的 jsessionid?
【发布时间】:2018-05-25 02:21:58
【问题描述】:

我需要帮助,如何从 url 中隐藏 jsessionid? 使用 jboss 5.0 和 web 应用程序版本 2.5。 在 jboss 的上下文中,我有

SessionCookie 安全 = "true"

httpOnly = "真"

你能帮帮我吗? “secure”和“httpOnly”必须保持设置为true

示例网址:http://localhost:8080/actionMenuGeneral.do;jsessionid=EA9073194BEDF67C16BEE48600B97737

谢谢

【问题讨论】:

    标签: java jboss jsessionid


    【解决方案1】:

    在应用程序的 web.xml 中更改以下内容

    <session-config>
        <session-timeout>60</session-timeout>
        <cookie-config>
            <http-only>true</http-only>
            <secure>true</secure>
        </cookie-config>
        <tracking-mode>COOKIE</tracking-mode>
    </session-config>
    

    更多详情https://access.redhat.com/solutions/338313

    【讨论】:

    • 我添加了标签,但出现以下错误:cvc-complex-type.2.4.d: Invalid content was found started with element 'cookie-config'。此时不需要子元素。
    猜你喜欢
    • 1970-01-01
    • 2011-12-10
    • 2012-07-04
    • 1970-01-01
    • 2012-02-29
    • 2015-10-25
    • 1970-01-01
    • 2019-08-13
    相关资源
    最近更新 更多