fix: rename cookie and make it domain level #98
Merged
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.
Fixes the cookie issue, which is stopping logins and logouts
Description
The issue is that the
alby_nostr_wallet_connect
cookie was saved in users' browsers under the nwc.getalby.com subdomain, and currently we add the alby_nostr_wallet_connect cookie under .getalby.com domain (and in other places, we don't specify the domain cause it does key value matching and we don't know if we get the cookie with subdomain or main domain). So instead of clearing it @bumi said it's better to rename the cookie.(apart from the issue Moritz mentioned in slack, you can't also log out if you're logged in already, that's because the cookie which is being cleared is of the subdomain and the main domain cookie is never being touched so when it fetches to log you in, this time it gets the main domain cookie (because, key value matching) and shows you the page, but the same thing (k-v matching) isn't applicable for delete as you have to explicitly mention if you need to delete a domain level cookie)