|
|
|
|
Re: Multiple RAP Sessions lead to Session Timeout [message #1783990 is a reply to message #1783988] |
Wed, 21 March 2018 09:22 |
Sebastian Ganser Messages: 6 Registered: August 2014 |
Junior Member |
|
|
Hi,
i tried the way mentionend in the FAQ entry [1] to configure jetty to not use cookies for session recognition by implementing a jettycustomizer, which is provided by a fragment-plugin and forces jetty to use url recognition. This works fine, but is this really the correct way to achieve what i want?
[1] http://wiki.eclipse.org/RAP/FAQ#How_to_run_a_RAP_application_in_multiple_browser_tabs.2Fwindows.3F
My assumption is that jetty is using the cookie to get/ask for the correct http session (serverside), but there is only one cookie for every host. In my case there are rap-applications running on the same host and everytime i connect to an rap app with the same browser a cookie is placed for the host (app 1 url 192.168.1.10:8081/test -> host:192.168.1.10). If i connect to another session (app 2 url 192.168.1.10:8082/test2 -> host: 192.168.1.10) the host is still the same, but jetty already generated a new sessionid, which is placed as cookie for the same host. So the cookie will be overwritten. After switching to the tab with the first opened rap app jetty will read the sessionid in the cookie and ask the session handler for the correct session, which cant be provided, because the id belongs to the session of the second rap-application and therefore rap signals a session timeout.
Could you give me your thoughts on that and maybe tell me what handler you are using for your rap demo apps?
I forgot to mention that i use RAP in combination with E4 (3.2.0). A snippet/project will be provided as soon as possible.
Regards,
Sebastian
|
|
|
|
Re: Multiple RAP Sessions lead to Session Timeout [message #1784051 is a reply to message #1783992] |
Wed, 21 March 2018 23:27 |
Chris Fairhall Messages: 221 Registered: February 2011 |
Senior Member |
|
|
So you're running two different instances of Jetty on the same host?
Two different instances can't share the same session cookie, that's a limitation of Jetty (and probably all application servers not in a cluster)
Cookies get shared between services on the same host even if they are on different ports.
You might be able to work around it by having Jetty set the context path in the session cookie, or maybe explicitly setting the port for the session cookie, so it doesn't get shared between the instances.
Edit: another couple of workarounds:
Set up different hostnames in your hosts file pointing to the same IP. Use different names for each instance, that will separate the cookies.
Alternatively, change the session cookie name for one or both Jetty instances
see https://stackoverflow.com/questions/24017645/set-jetty-session-cookie-name-programmatically
[Updated on: Thu, 22 March 2018 01:39] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03670 seconds