Fix: Cookie deletion in Admin Interface#1091
Merged
jelmer merged 3 commits intoisso-comments:masterfrom Mar 7, 2026
Merged
Conversation
Previously, the 'Log Out' button on the admin interface did nothing when clicked in Firefox or Chrome. Because 'admin-session' is created as a HostOnly cookie with no domain specified, log_out() needs to refrain from attempting to target the cookie using a domain as well. To properly target the HostOnly cookie, the 'domain' attribute should simply be omitted. Refer to the login logic and cookie creation here: - https://github.com/isso-comments/isso/blob/bd689143c3b9bd0fea83382bf4c1a1993586520c/isso/views/comments.py#L1439
jelmer
approved these changes
Mar 7, 2026
There was a problem hiding this comment.
Pull request overview
Fixes admin logout reliability in modern browsers by adjusting how the admin-session cookie is expired to correctly target the host-only cookie created during login.
Changes:
- Remove the
Domainattribute when expiring theadmin-sessioncookie in the admin UI logout handler. - Add a changelog entry documenting the admin logout bugfix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
isso/js/admin.js |
Updates logout cookie expiration to omit Domain, ensuring the host-only admin-session cookie is properly cleared. |
CHANGES.rst |
Documents the user-visible admin logout fix in the changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Checklist
CHANGES.rstbecause this is a user-facing change or an important bugfixWhat changes does this Pull Request introduce?
This PR removes the
Domainattribute from the logic that targets theadmin-sessioncookie for deletion/expiration.Why is this necessary?
Currently, the 'Log Out' button on the admin interface does nothing when clicked in Firefox or Chrome with
isso:latest(b8d865c497e396b927a9f85717f37ea6b3db66b18e0fd055b2786a4dc601d53c).The
admin-sessioncookie is created with aHostOnlycookie flag because the login logic does not specify a value for theDomainattribute.Because the cookie is flagged as a
HostOnlycookie,log_out()should refrain from attempting to target the cookie using a specified domain as well. In doing so, the line:attempts to target a different cookie that does not exist.
To properly target the
HostOnlycookie, theDomainattribute should simply be omitted.Please refer to the login logic and cookie creation here for reference:
isso/isso/views/comments.py
Lines 1439 to 1453 in bd68914