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>

 

posted on 2019-06-20 09:36  正义的伙伴!  阅读(1983)  评论(0编辑  收藏  举报

导航

//增加一段JS脚本,为目录生成使用