码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-11-04 11:16:39      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:http   io   ar   os   for   div   on   art   html   

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   io   ar   os   for   div   on   art   html   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!