【转】session tags
来源:互联网 发布:短信端口 编辑:程序博客网 时间:2024/05/14 16:59
In the <web-app-default> block, you can define a <session-config> block:
<session-config>
<session-max>4096</session-max> <!--Default is 4096-->
<session-timeout>20</session-timeout> <!--Default is 30 minutes-->
<enable-url-rewriting>false</enable-url-rewriting>
</session-config>
See <http://caucho.com/resin-3.1/doc/session-tags.xtp> for a list of all the possible session configuration tags.
http://caucho.com/resin-3.1/doc/session-tags.xtp
session tags
<server> variables
Resin adds a number of additions to the standard
tag.- <cookie-domain>
- <cookie-length>
- <cookie-max-age>
- <cookie-version>
- <ignore-serialization-errors>
- <session-config>
- <session-max>
- <save-mode>
- <session-timeout>
<cookie-domain>
child of session-config
<cookie-domain> configures the host domain to use for sessions, i.e. value of the Domain cookie attributes.
By default, browsers only send cookies back to the exact host which sent them. In some virtual host cases, it makes sense to share the same cookie value for multiple virtual hosts in the same domain. For example, cookie-domain
would be set to .
<resin xmlns="http://caucho.com/ns/resin"><cluster id="app-tier"> <host id="caucho.com"> <host-alias>gryffindor.caucho.com</host-alias> <host-alias>slytherin.caucho.com</host-alias> <web-app-default> <session-config cookie-domain="caucho.com"/> </web-app-default> </host></cluster></resin>
<cookie-length>
child of session-config
<cookie-length> sets the length of the generated cookie value. In some rare cases, the cookie-length might need to be shortened or the cookie-length might be extended to add randomness to the cookie value. For the most part, this value should be left alone.
default 14
<cookie-max-age>
child of session-config
<cookie-max-age> sets how long the browser should keep the session cookie.
By default, browsers keep cookies as long as they are open. When the browser is restarted, the cookies are dropped. cookie-max-age tells the browser to keep the cookie for a certain time period. Applications can make this time "infinite" by setting a large number.
<cookie-version>
<cookie-version> sets the version of the cookie spec for sessions.
default 1.0
<ignore-serialization-errors>
child of session-config
<ignore-serialization-errors> is used with persistent sessions in certain rare cases where some session data is serializable and other data is not serializable. <ignore-serialization-errors> simply skips session values which do not implement java.io.Serializable
when serializing the session.
default false
<session-config>
Session configuration parameters.
Resin adds a number of
tags.By default, both enable-cookies
and enable-url-rewriting
are true. To force url rewriting, you would create a configuration like:
<web-app id='/'> <session-config enable-cookies='false' enable-url-rewriting='true'/></web-app>
The session-timeout
are purged.
<web-app id='/dir'> <session-config> <!-- 2 hour timeout --> <session-timeout>120</session-timeout> <session-max>4096</session-max> </session-config></web-app>
is used to limit the maximum length for the session's generated cookie for special situations like WAP devices. Reducing this value reduces the randomness in the cookie and increases the chance of session collisions.
defaults to true so that Resin can share the session id amongst different web-apps.
The class that corresponds to <session-config> is com.caucho.server.session.SessionManager
<session-max>
child of session-config
<session-max> sets the maximum number of sessions stored in memory for a particular <web-app>. The total number of persisted sessions may be larger.
default 4096
<save-mode>
child of session-config
<save-mode> configures when Resin should save a persistence session during a request. The values are:
after-requestSave the session after the request has been served and completedbefore-headersSave the session before sending headers to the browseron-shutdownOnly save the session when Resin is shutting downIn some situations, like redirects, a fast browser can send a request back to Resin before the session is persisted with the
save-mode. If the server is configured without sticky sessions, the load balancer might send the request to a different server, which may not get the updated session. In the situation, either the save-mode should be changed to or sticky sessions should be enabled.If the save-mode is
, the application should take care to make any session changes before sending data to the browser.default after-request
<session-timeout>
child of session-config
<session-timeout> sets how long a <web-app> should keep an idle session before invalidating it. The value is specified in minutes.
default 30min
- 【转】session tags
- Struts2--struts-tags (转)
- tags
- (转)flv文件格式解读之音频tags
- (转)flv文件格式解读之视频tags
- Vim+cscope+ctags+tags linux下阅读源代码 [转]
- AJAX Tags
- 关于tags
- 什么是Tags?
- 什么是Tags?
- phpDocumentor - tags
- Bean:Tags
- SOME TAGS
- XHTML Tags
- 标记(Tags)
- Decorator Tags
- tags.tld
- tags-vim
- sqlserver链接服务器使用方法
- 如何去掉^M 符号
- 提高开发效率,节省你的时间时间--CSS工具推荐
- discuz7.0gbk版安装之后出现白屏。在线等……
- ACE篇之一:使用ACE日志设施
- 【转】session tags
- Google Gson的一个便捷工具类
- SQLSERVER基本操作语句
- 你知道输出什么吗
- 终于成为一名测试人员
- oracle启动 /停止的几种方法以及 启动和停止过程中出错的解决办法
- 管理与开发
- 十年总结(五):自信心膨胀后,遭遇挫折
- SYBASE CTLIB简单的内存池分配 实现 避免内存频繁分配