Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Getting jsessionid from URL instead of cookie

843841Nov 2 2005 — edited Aug 23 2008
I am processing the following request in a servlet: "http://hostname.com/home;jessionid=1111". In addition to being sent in the URL, "jsessionid" is also being sent as a cookie.

In this case, is there a way to get the session id value from the URL instead of the cookie? The method HttpServletRequest.getRequestedSessionId() always returns the cookie value if both mechanisms are used. And the method HttpServletRequest.getRequestURL() returns the url with the jsessioniD stripped (e.g. http://hostname.com/home). If I try a different parameter after the semi-colon (e.g. http://hostname.com/home;myvalue=1111), then HttpServletRequest.getRequestURL() does not strip it off.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2008
Added on Nov 2 2005
9 comments
5,713 views