O3-1444: Expired login session keeps the location page stuck #580
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements
For changes to apps
If applicable
Summary
The session is saved as a global store using developit/unistore (https://github.com/developit/unistore). This session object is only updated either by clearing the session store (https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L188), or by refetching the current user (https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/shared-api-objects/current-user.ts#L163).
However, clearing or refetching the session store depends on only timeout and if the store is loaded, but doesn't check for the availability the JSESSIONID cookie. At the same time, this cookie is an HTTP-ONLY cookie so it ain't available via document.cookie.
to make this work, i manually opted to verifying that the user is logged in twice. As this is working, it might be not working wright.
cc @brandones @denniskigen @vasharma05 @ibacher @hadijahkyampeire
Screenshots
to.github.mov
Related Issue
https://issues.openmrs.org/browse/O3-1444
Other