-
Notifications
You must be signed in to change notification settings - Fork 176
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
fix: reconnect web components after session expiration #20407
fix: reconnect web components after session expiration #20407
Conversation
After session expiration, Flow client in webcomponent mode send a GET request to the server to re-initialize itself with a valid session cookie. However, the XHR call is done with the withCredentials flag set to false, making the browser ignore the Set-Cookie header in the response. This change forces the withCredential flag to true for resync request so that the new cookie can be handled by the browser and reused in the subsequent request that re-intitializes the embedded component. If PUSH is enabled, it also restores the connection after resynchornization request to make sure pending invocation queue, and especially the webcomponent connected events, can be flushed correctly and sent to the server. Also temporarily suspends hearbeat during resynchronization request to prevent issue with concurrent requests, potentially causing duplicated session expiration handling on the client. Fixes #19620
4654363
to
ca4ec51
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Else seems to work and does reconnect also with push configured.
* fix: reconnect web components after session expiration After session expiration, Flow client in webcomponent mode send a GET request to the server to re-initialize itself with a valid session cookie. However, the XHR call is done with the withCredentials flag set to false, making the browser ignore the Set-Cookie header in the response. This change forces the withCredential flag to true for resync request so that the new cookie can be handled by the browser and reused in the subsequent request that re-intitializes the embedded component. If PUSH is enabled, it also restores the connection after resynchornization request to make sure pending invocation queue, and especially the webcomponent connected events, can be flushed correctly and sent to the server. Also temporarily suspends hearbeat during resynchronization request to prevent issue with concurrent requests, potentially causing duplicated session expiration handling on the client. Fixes #19620 * add tests
* fix: reconnect web components after session expiration After session expiration, Flow client in webcomponent mode send a GET request to the server to re-initialize itself with a valid session cookie. However, the XHR call is done with the withCredentials flag set to false, making the browser ignore the Set-Cookie header in the response. This change forces the withCredential flag to true for resync request so that the new cookie can be handled by the browser and reused in the subsequent request that re-intitializes the embedded component. If PUSH is enabled, it also restores the connection after resynchornization request to make sure pending invocation queue, and especially the webcomponent connected events, can be flushed correctly and sent to the server. Also temporarily suspends hearbeat during resynchronization request to prevent issue with concurrent requests, potentially causing duplicated session expiration handling on the client. Fixes #19620 * add tests
…24.4) (#20440) * fix: reconnect web components after session expiration (#20407) * fix: reconnect web components after session expiration After session expiration, Flow client in webcomponent mode send a GET request to the server to re-initialize itself with a valid session cookie. However, the XHR call is done with the withCredentials flag set to false, making the browser ignore the Set-Cookie header in the response. This change forces the withCredential flag to true for resync request so that the new cookie can be handled by the browser and reused in the subsequent request that re-intitializes the embedded component. If PUSH is enabled, it also restores the connection after resynchornization request to make sure pending invocation queue, and especially the webcomponent connected events, can be flushed correctly and sent to the server. Also temporarily suspends hearbeat during resynchronization request to prevent issue with concurrent requests, potentially causing duplicated session expiration handling on the client. Fixes #19620 * add tests * fix pom files --------- Co-authored-by: Marco Collovati <[email protected]>
…24.5) (#20439) * fix: reconnect web components after session expiration (#20407) * fix: reconnect web components after session expiration After session expiration, Flow client in webcomponent mode send a GET request to the server to re-initialize itself with a valid session cookie. However, the XHR call is done with the withCredentials flag set to false, making the browser ignore the Set-Cookie header in the response. This change forces the withCredential flag to true for resync request so that the new cookie can be handled by the browser and reused in the subsequent request that re-intitializes the embedded component. If PUSH is enabled, it also restores the connection after resynchornization request to make sure pending invocation queue, and especially the webcomponent connected events, can be flushed correctly and sent to the server. Also temporarily suspends hearbeat during resynchronization request to prevent issue with concurrent requests, potentially causing duplicated session expiration handling on the client. Fixes #19620 * add tests * fix pom files --------- Co-authored-by: Marco Collovati <[email protected]>
This ticket/PR has been released with Vaadin 24.6.0.alpha3 and is also targeting the upcoming stable 24.6.0 version. |
Description
After session expiration, Flow client in webcomponent mode send a GET request
to the server to re-initialize itself with a valid session cookie.
However, the XHR call is done with the withCredentials flag set to false,
making the browser ignore the Set-Cookie header in the response.
This change forces the withCredential flag to true for resync request
so that the new cookie can be handled by the browser and reused in the
subsequent request that re-intitializes the embedded component.
If PUSH is enabled, it also restores the connection after resynchornization
request to make sure pending invocation queue, and especially the
webcomponent connected events, can be flushed correctly and sent to the
server.
Also temporarily suspends hearbeat during resynchronization request to prevent
issue with concurrent requests, potentially causing duplicated session
expiration handling on the client.
Fixes #19620
Type of change
Checklist
Additional for
Feature
type of change