Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Cannot verify TOTP after successfully setting up 2FA, getting `INVALID_TWO_FACTOR_COOKIES` - Better Auth
BA
Better Auth
•
8mo ago
•
7 replies
Budi
Cannot verify TOTP after successfully setting up 2FA, getting `INVALID_TWO_FACTOR_COOKIES`
I can successfully enable TwoFactor
, show the QR and backup codes
, and verify it with a generated code
. This sets
twoFactorEnabled
twoFactorEnabled
to
TRUE
TRUE
for the user
.
However when that user later logs out and back in
, and needs to verify their 2FA TOTP code
, I get this error
INVALID_TWO_FACTOR_COOKIES
INVALID_TWO_FACTOR_COOKIES
. No two factor cookies are being set anywhere
, and I have tried to log them but they aren
't generated by the enable nor verify TOTP in my
totp/setup
totp/setup
routes
.
What could be the issue
? Thank you
.
Better Auth
Join
9,988
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
2FA Totp
BA
Better Auth / help
11mo ago
Invalid two factor cookie
BA
Better Auth / help
9mo ago
2FA getting error generating totp uri
BA
Better Auth / help
9mo ago
Handling better-auth.two_factor cookie after TOTP verification and logout
BA
Better Auth / help
10mo ago