首页 > 其他 > 详细

删除 Tomcat 上次关闭遗留下来的 SESSION 缓存

时间:2014-11-04 11:14:21      阅读:337      评论:0      收藏:0      [点我收藏+]

Default Session Persistence for a Web Application (explained..)

By default Tomcat (5.x onwards, based on my knowledge) persists all the user session (HttpSession) objects. Tomcat maintains these session objects for individual web apps under it‘s work directory. So if your web application context is myapp, Tomcat persists the session objects in a file named SESSIONS.ser under directory %Tomcat_Home%/work/Catalina/localhost/myapp. The session persistence works across Tomcat or web application restarts.

Disabling Session Persistence

This session persistence of-course may not be a needed feature for all types of web applications. So someone may want to just disable the session persistence. To do this,
Open file %Tomcat_Home%/conf/context.xml
This file by default has standard manager implementation configured, which implements the session persistence across Tomcat or web-app restarts.
To disable the session persistence, uncomment the line <Manager pathname="" />

Here is official Tomcat documentation reference link for this -
http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html#Disable_Session_Persistence

remove it use shell

my $SESSION_CACHE_FILE = "$CATALINA_BASE/work/Catalina/localhost/_/SESSIONS.ser";
if ( -e $SESSION_CACHE_FILE ) {
    unlink $SESSION_CACHE_FILE;
}

删除 Tomcat 上次关闭遗留下来的 SESSION 缓存

原文:http://my.oschina.net/sub/blog/340415

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!