• resin中配置session相关参数


    【转】关于resin的 session 的持久化(存储) (一)  

     遇到项目菜单容易在30分钟后出现timeout页面超时,提示用户重新登录问题,已在项目配置文件web.xml中查找未发现配置timeout的相关配置。
     但用户反馈每30分钟出现此情况。
     
    检查服务器配置resin.conf尚未配置session的timeout参数。在以下材料中的值如果服务器不配置则默认session-timeout为30分钟,且若服务器配置resin.conf与项目配置web.xml同时配置timeout,则服务器配置优先级最高。
     

       关于resin的session配置例子如下,session持久化的配置:

          <session-config>
                <session-max>16686</session-max>
                <session-timeout>40</session-timeout>
                <enable-cookies>true</enable-cookies>
                <enable-url-rewriting>true</enable-url-rewriting>
                <file-store>WEB-INF/sessions</file-store><!-- 存储位置-->
                 <always-load-session>true</always-load-session>
         </session-config>

    session-config的其它配置参数如下

    session-config

     
    AttributeMeaningDefault
    session-timeout The session timeout in minutes 30 minutes
    session-max Maximum active sessions 4096
    enable-cookies Enable cookies for sessions (resin 1.1) true
    enable-url-re writing Enable URL rewriting for sessions (resin 1.1) true
    cookie-version Version of the cookie spec for sessions (resin 1.2) 1.0
    cookie-domain Domain for session cookies (resin 1.2) none
    cookie-max-age Max age for persistent session cookies (resin 2.0) none
    cookie-length Maximum length of the cookie. (resin 2.1.1) Integer.MAX_VALUE
    file-store Persistent sessions using a file store (resin 1.2) none
    jdbc-store Persistent sessions using a JDBC store (resin 1.2) none
    tcp-store Persistent sessions using a distributed ring (resin 1.2) none
    always-load-session Reload data from the store on every request (resin 1.2) false
    always-save-session Save session data to the store on every request (resin 1.2) false
    save-on-shutdown Only save session when the application shuts down. (resin 1.2.3) false
    reuse-session-id Reuse the session id even if the session has timed out. (resin 2.0.4) true
    ignore-serialization-errors When persisting a session, ignore any values which don't implement java.io.Serializable false

    1,第一种格式为例子中的格式

    2,<session-config session-timeout='120'/><!--session-timeout  为属性-->

    3,<session-config>
              <session-timeout id=120/>
              <session-max id=4096/>
           </session-config>



     

  • 相关阅读:
    hdu 1290 献给杭电五十周年校庆的礼物 (DP)
    hdu 3123 GCC (数学)
    hdu 1207 汉诺塔II (DP)
    hdu 1267 下沙的沙子有几粒? (DP)
    hdu 1249 三角形 (DP)
    hdu 2132 An easy problem (递推)
    hdu 2139 Calculate the formula (递推)
    hdu 1284 钱币兑换问题 (DP)
    hdu 4151 The Special Number (DP)
    hdu 1143 Tri Tiling (DP)
  • 原文地址:https://www.cnblogs.com/yuedanfengqing/p/4318065.html
Copyright © 2020-2023  润新知