-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Disconnected session cookie not removed after connecting again #4097
Comments
yeah same issue |
Yep confirm this issue exists. My fix for now is to delete |
I tried to opt out the |
I had a poke at this, it seems setting a different cookie path fixes the issue as cookies with the path |
This issue has been locked since it has been closed for more than 14 days. If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Wagmi version. If you have any questions or comments you can create a new discussion thread. |
Check existing issues
Describe the bug
When calling
disconnect
, wagmi would normally store a session cookie likewagmi.io.metamask.disconnected
so the page stays disconnected after a refresh.However, this cookie should be cleared/removed if the user connects again. This removal of the "disconnected" cookie currently only works when the the "connect" call is made on the root
/
and first level pages (e.g./foo
) but NOT on pages that are deeper (e.g./bar/qux
or/a/b/c
).Link to Minimal Reproducible Example
https://wagmi-bug.vercel.app/
Steps To Reproduce
(Code is available at https://github.com/dengpeng/wagmi-bug)
Correct behavior:
wagmi.io.metamask.disconnected
is set.wagmi.io.metamask.disconnected
is removed. ✅Incorrect behavior:
wagmi.io.metamask.disconnected
is set.wagmi.io.metamask.disconnected
is NOT removed. ❌What Wagmi package(s) are you using?
wagmi, @wagmi/core
Wagmi Version
@wagmi/core@2.11.5, wagmi@2.10.8
Viem Version
2.16.3
TypeScript Version
5
Anything else?
No response
The text was updated successfully, but these errors were encountered: