-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot run two applications on localhost (with different ports) in same browser #17593
Comments
If the host is the same, the applications should have different cookie names. Here are a couple of excerpts from the RFC 6265
Security Considerations > Weak Confidentiality
In a Spring Boot application the cookie name can be with the server.servlet.session.cookie.name property |
I am not using Spring Boot, just running off an embedded Jetty. |
I suppose a ServletContextListener could be a good point to set the session cookie name. |
There is a generic Servlet API call.
Is there a reason that Vaadin can't set the cookie name to some random junk and avoid this forever ? |
At least this is something we have to describe in the online documentation. |
Vaadin has no way of preserving that random junk over server restarts and we wouldn't want to cause hundreds or thousands of different cookie names to end up the the developer's browser. |
Thanks. I was just observing junk accumulation myself. |
Documentation has been updated. |
Description of the bug
If I run two Vaadin applications on (say) localhost:8080 and localhost:8081 I cannot access them from the same browser - the UIs start updating randomly until one of the two is closed.
It is necessary to either use two different browsers, or to fake the addresses to 127.0.0.1:8080 and 127.0.0.2:8081
Expected behavior
Two URLs have the same origin if the protocol, port (if specified), and host are the same for both.
Since the applications are from different origins, they should be considered different
Minimal reproducible example
Run any two Vaadin applications simultaneously on localhost:8080 and localhost:8081, access them from the same browser.
(may or may not be relevant: Both applications have @Push enabled.)
Versions
Vaadin: 24.1.9
Flow: 24.1.11
Java: JetBrains s.r.o. 17.0.6
OS: amd64 Windows 11 10.0
Browser: Chrome Edge Firefox
Live reload: Java active (HotswapAgent): Front end active
The text was updated successfully, but these errors were encountered: