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

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;
}

转载于:https://my.oschina.net/sub/blog/340415

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值