| Reading the previous comments once again, I don't see anyone referring the impact on slaves and the performance. Sorry if my attempt to give more feedback is annoying some. Not coding too much my self, I'm trying to support community in other ways. Daniel Beckham, since you've already pointed at the cause and proposed a possible fix, do you expect us (the not very original users) to send a pull request with the solution you're proposing (hash port number)??? Meanwhile, I'd like to find workaround for our situation that does not require me patching and compiling Jenkins from source or restarting every browser and slave after each restart of the master... Since Daniel Beckham wants something original, here is my modest contribution that works for us for Apache (with mod_rewrite and mod_header):
- Detect multiple session cookies and extract the oldest (assuming it's the first set in the Cookie string)
RewriteCond "% {HTTP_COOKIE} " ".(JSESSIONID\.[^=])=.(JSESSIONID\.[^=])=[^;]+.*"
- Store the name of this session cookie in an environment variable
RewriteRule /jenkins/ - [env=OLDJSESSIONID:%1]
- Expire this obsolete session cookie if found
Header add Set-Cookie "% {OLDJSESSIONID} e=;Expires=Thu, 01 Jan 1970 00:00:01 GMT;Path=/jenkins;Secure;HttpOnly" env=OLDJSESSIONID
I've tested this with Firefox and Chromium and it looks ok for now... But, in my opinion, randomizing the cookie name is a bad idea from the first place. I'm in deeply in favor of a static name, based on the context_path and/or the port number by default, or a custom property. |