Created attachment 25171 [details] Patch skiping SESSIONS.ser file creation if no session exists When a webapp is unloaded, a SESSIONS.ser file is created even if no session exists for the application. This is useless.
Patch applied on trunk, it will be available for tomcat 7.0.6. Backport to tomcat 6 proposed.
In fact the patch was incomplete and applying it as it introduces a bug: if no session exist, no SESSIONS.ser should be created AND previous SESSIONS.ser should be deleted (if any old file exists).
(In reply to comment #2) AFAIK, the SESSIONS.ser file is deleted in StandardManager.doLoad() upon successful or unsuccessful attempt to read it. Do you have a scenario where a stale SESSIONS.ser file is left behind?
(In reply to comment #3) I hadn't checked doLoad(). I was only thinking that not writing a file with 0 sessions could have a consequence. I think that you're right and that no problem should occur.
Thanks again for the patch. This has been applied to 6.0.x and will be included in 6.0.30 onwards.