java web.xml session 配置


    <web-app>
<session-config>
        <session-timeout>120</session-timeout>
        <cookie-config>
            <name>lycyjcpt-session</name>
            <http-only>true</http-only>
            <secure>false</secure>
            <max-age>1800</max-age>
        </cookie-config>
    </session-config>
</web-app>

 一般用上面的就可以了。

 

下面是详细配置

<session-config>
    <session-timeout>30</session-timeout>
    <cookie-config>
        <name>JSESSIONID</name>
        <domain>example.org</domain>
        <path>/shop</path>
        <comment>
            <!-- some information -->
        </comment>
        <http-only>true</http-only>
        <secure>false</secure>
        <max-age>1800</max-age>
    </cookie-config>
    <tracking-mode>COOKIE</tracking-mode>
    <tracking-mode>URL</tracking-mode>
    <tracking-mode>SSL</tracking-mode>
</session-config>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM