fix: clear all session data on logout #5429
Open
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.
This PR updates logout logic to remove
developer_token
,exchanged_developer_token
andcsrf_token
from the Flask session cookie. Currently the old values are never removed from the session and some brand store features (e.g. Models) become inaccessible after 24 hours even after logging out, unless the session cookie is removed manually by the user.Done
How to QA
Ideally the best way to make sure that this fixes the issue is by logging in on the demo site and waiting for 24 hours for the macaroons to expire, then go though the SSO auth again to check if the
developer_token
gets refreshed correctly. This is quite cumbersome, so the next best thing to test is what happens when you log out (since this is effectively what happens when visiting publisher routes with an expired macaroon).session
cookie/logout
and check the response cookiesSet-Cookie
header should start withsession=;
session
cookie should have disappearedTesting
Issue / Card
Fixes #5414 (WD-29847)
Screenshots