Bug 57089 - Configuration of <SessionIdGenerator> element is lost on reload
Summary: Configuration of <SessionIdGenerator> element is lost on reload
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.14
Hardware: PC All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-14 12:32 UTC by Konstantin Kolinko
Modified: 2014-10-16 19:02 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2014-10-14 12:32:11 UTC
From "Question of new SessionIdGenerator implementation." thread on dev@,
http://tomcat.markmail.org/thread/2lic23zbhesgftld

If reloading Manager( or Context), SessionIdGenerator is cleared in ManagerBase.stopInternal() and re-created in ManagerBase.startInternal().

Expected: If there is <SessionIdGenerator> element in a <Manager> element, restarting a web application should preserve the options set on it.

Actual: Any configuration options specified on <SessionIdGenerator> configuration element are lost.

Workaround
-----------
A workaround is to specify attributes such as "sessionIdLength" on Manager element.

Fix
----
The fix is probably to let SessionIdGenerator to implement Lifecycle interface.

The "this.sessionIdGenerator = null;" assignment in ManagerBase.stopInternal() originates from r1044874. The old code before r1044874 was calling "randoms.clear();" there. I think it is easier to expose that clear method via Lifecycle.stop().

Technically, there was no bug in r1044874 itself, as that was just an internal implementation change. It have not exposed SessionIdGenerator as a configuration element.

The ability configure session id generator via an XML element was added later in r1619056.
Comment 1 Mark Thomas 2014-10-16 19:02:10 UTC
This has been fixed in 8.0.x and will be included in 8.0.15 onwards.