[wildfly-dev] 2 instance cluster in master/slave

Arun Gupta arun.gupta at gmail.com
Fri May 30 19:46:03 EDT 2014


>>
>> The session ids are indeed different. Just pushed out the latest blog
>> in this series at:
>>
>>
>> http://blog.arungupta.me/2014/05/wildfly-managed-domain-raspberrypi-techtip27/
>>
>> The session id are shown towards the end in screen snapshots, and are
>> indeed different.
>
>
> This is a common mistake. You need to think about how HTTP cookies work in
> the browser. If you create a session you are receiving a cookie, the browser
> is going to send that cookie that identifies that session only for the same
> *domain* (whole RFC and details here
> http://tools.ietf.org/html/rfc6265#page-16 ).
>
> Given your setup, the domains are 10.0.0.27 and 10.0.0.28, respectively.
> That means the domain is different and cookies will *not* be sent and thus a
> new session will be created.
>
> If you were to use port offsetting it's a whole different story, same as
> when you are switching from HTTP/80 to HTTPS/443 you keep your session
> (watch out for secure cookies though).
>
> To test, you either need to spoof the cookie (e.g. in the WF testsuite we
> are using a HTTP client that overrides the domain matching logic to be
> relaxed) or use a loadbalancer like mod_proxy or mod_cluster and then the
> domain will be the address of the loadbalancer.
>
> So what you are seeing is correct and expected behavior.

This was it.

After setting up the LB, and accessing the pages through LB shows the
intended behavior.

Arun

>
> Cheers,
> Rado



-- 
http://blog.arungupta.me
http://twitter.com/arungupta


More information about the wildfly-dev mailing list