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