Gyan
Gyan

Reputation: 1176

Clear all sessions for web application in tomcat 7

I'm trying to update a couple of JAR files after my web application starts and doing a restart for the changes to take effect.(requirement) The problem is , the session information is being persisted by tomcat. Yes, I do have a "sessionEventListener" listener in my application, but that shouldn't be a problem IMHO.

I want everything to start afresh from tomcat ( running standalone) , be it sessions, cache, or any information about the web application given to tomcat, except for the WAR file of course.

Any help would be appreciated.

Upvotes: 6

Views: 14020

Answers (2)

Nikhil
Nikhil

Reputation: 182

In your tomcat 7 context.xml you can add/uncomment this line to clear all sessions on tomcat restart.

<Manager pathname="" />

Upvotes: 3

Kennet
Kennet

Reputation: 5796

During development (in Eclipse) I usually use 'Clean Tomcat Work Directory' option found when right clicking on Servers view. That will wipe all session related data.

Upvotes: 9

Related Questions