java web.xml session 配置

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:13   3258   0
    <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>

转载于:https://www.cnblogs.com/whm-blog/p/11056788.html

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP