Skip to main content

[webtier] Re: http session lost when switching from https to http (on cluster)

1 reply [Last post]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

On 02/26/09 04:09 AM, wrote:
> Hi,
> I'm trying to setup glassfish cluster, one node with two instances. It starts without problem, I can deploy sample applications and http session is maintained between instances. Except one scenario:
> open unsecure pages (http://)
> open secure pages (https://)
> open unsecure page again - here session is lost
> It does not matter if I switch between instances or not
> I have found that the JSESSIONIDVERSION cookie is not sent when I open unsecure page from secure page.
> Does anyone have similar problem?
> I'm using GlassFish v2.1 b60e, jdk 1.6.0_07 on Ubuntu 8.04.
> Testing with Firefox 3 and opera 9.6.

Thanks for this report!

Here's an explanation for what you are seeing:

Unlike a JSESSIONID cookie, a JSESSIONIDVERSION cookie is delivered
with every response.

In your scenario, the (first) request that initiates the session is over
As a result, the JSESSIONID cookie returned with the response is marked
as non-secure, meaning it will be returned by the client with any subsequent
requests targeted to your app, regardless of whether those requests are over

If one of the subsequent requests is over HTTPS, the returned
JSESSIONIDVERSION cookie will be marked as secure, meaning it will *not*
be returned by the client with a subsequent HTTP request.

This is exactly what you are seeing!

One way to fix this would be to have the JSESSIONIDVERSION cookie
always inherit the security setting of the associated JSESSIONID cookie,
instead of the security setting from the request.


> [Message sent by forum member 'adeboinfo' (adeboinfo)]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail: