How to change length of generated JSESSIONID with Liberty?
Asked Answered
L

2

6

I am getting some warning messages when running my project on Liberty, specifically in Chrome.

[WARNING ] Detected JSESSIONID with invalid length; expected length of 23, found 28, setting: BD14EBEEDBE53803FAE565131A03 to null.

This is because Liberty is generating a JSESSIONID of length 28, but the Liberty profile defaults the httpSession property idLength to 23. If I set

<httpSession idLength="28" />

in the Liberty server.xml I do not get these warning messages in the log. However, I would like to solve this without altering the server.xml.

Is it possible to change how the JSESSIONID is generated to default to length of 23? Or perhaps this is a poor approach?

Lucifer answered 22/10, 2014 at 16:21 Comment(1)
There some mistype in the sentence - "This is because Liberty is generating a JSESSIONID of length 28, but the Liberty profile defaults the httpSession property idLength to 23". You meant different product at the begining.Chlorosis
A
7

I got this error after upgrading my version of WebSphere to 8.5.5.8. What finally did the trick was to delete my browser cookies. I suspect what was happening is that the browser was using the old (longer) JSESSION cookies from the earlier version of WebSphere.

Associative answered 11/3, 2016 at 22:37 Comment(0)
C
2

WebSphere by default creates JSESSIONID of 23 length. So in your case you must be having on the same host different application server or web container, which creates different session cookie. The best way to avoid these problems would be to change default cookie name for one of the products installed. Changing length to 28 will only solve message in the log, but you will get application errors instead, since Websphere will look for a sessions it doesnt have, and the other way around - the other app server, when will receive cookie generated by WebSphere won't find the session also.

Check this link: http://www-01.ibm.com/support/docview.wss?uid=swg21671600

Chlorosis answered 22/10, 2014 at 17:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.