Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsMultiple RAP Sessions lead to Session Timeout
https://www.eclipse.org/forums/index.php/mv/msg/1092296/1783730/#msg_1783730
i am asking for help, because i ran into trouble with multiple RAP sessions and Jetty handling those sessions in one browser with multiple tabs. Everything works fine if only use one session in one tab, but when i open another tab (same browser) and load the second RAP application the first session gets a Session Timeout ("The server session timed out"). Both RAP applications are running on the same server and are reachable on the same adress with different ports and different servlet paths.
I already found some information to prevent this "Session Timeout", but those posts and the FAQ entry are relying on RAP 2.1.0.
Is this still the correct way to avoid the "Session Timeout" problem and if yes, are their any limitations for using this?
Thanks for your help!
Regards,
Sebastian]]>Sebastian Ganser2018-03-16T11:08:28-00:00Re: Multiple RAP Sessions lead to Session Timeout
https://www.eclipse.org/forums/index.php/mv/msg/1092296/1783954/#msg_1783954
I can't reproduce it with our online demos:
Both apps are running in different tabs without problems. Is this happens in all browsers? Are you using statics? Could you give RAP 3.4 a try?
HTH,
Ivan]]>Ivan Furnadjiev2018-03-20T16:38:55-00:00Re: Multiple RAP Sessions lead to Session Timeout
https://www.eclipse.org/forums/index.php/mv/msg/1092296/1783983/#msg_1783983
thanks for your reply. I tried it with your rap demo apps and they work correctly as you said, but i noticed a difference in networktraffic between those demo apps and my rap applications. I can't determine the cause of the difference, but my apps are placing a cookie containing information like "settingStore=1501825988417_0; JSESSIONID=node010clg1s2ymn7i8ahygqphrdjy0.node0" and those demo apps aren't.
Does rap/jetty recognize the session by reading the JSESSIONID entry of the placed cookie? If yes, why aren't your demo applications using cookies?
This happens with following browsers:
Chrome Version 64.0.3282.186 (64-Bit)
Firefox 59.0.1 (64-Bit)
Internet Explorer 11.0.9600.18860 (64-Bit)
I will give RAP 3.4.0 a try, but sadly i am bound to version 3.2.0 by the project.
Regards,
Sebastian
]]>Sebastian Ganser2018-03-21T07:38:49-00:00Re: Multiple RAP Sessions lead to Session Timeout
https://www.eclipse.org/forums/index.php/mv/msg/1092296/1783988/#msg_1783988
the HTTP session is handled by the application container - Jetty in your case. When 2 tabs are used in the same browser, the HTTP session is the same, but we have 2 RAP UI sessions on the server. I don't think that session cookie is a problem here. In order to help you I need at least a simple snippet/project to reproduce the issue.
Regards,
Ivan]]>Ivan Furnadjiev2018-03-21T08:36:39-00:00Re: Multiple RAP Sessions lead to Session Timeout
https://www.eclipse.org/forums/index.php/mv/msg/1092296/1783990/#msg_1783990
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?
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]]>Sebastian Ganser2018-03-21T09:22:28-00:00Re: Multiple RAP Sessions lead to Session Timeout
https://www.eclipse.org/forums/index.php/mv/msg/1092296/1783992/#msg_1783992
[1]https://github.com/JayzayGer/rapsessiontimeout-example
Just launch both launch-configs and connect to those apps with the same browser.
Regards,
Sebastian]]>Sebastian Ganser2018-03-21T09:57:33-00:00Re: Multiple RAP Sessions lead to Session Timeout
https://www.eclipse.org/forums/index.php/mv/msg/1092296/1784051/#msg_1784051
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.