Convex logout: why you need a full reload
// What you'd naturally do
await authClient.signOut();
router.push("/login");It works. The user lands on /login. The cookie is deleted.
But if you inspect the network tab or drop a console.log on your Convex queries — they're still running. For a few seconds, the old Convex cache is still active.
In most apps this doesn't cause a visible issue. But with sensitive data — orders, balances, personal info — you risk showing data from the previous session to the next user who logs in on the same device.
The cause: Convex keeps an in-memory cache on the client. router.push() doesn't clear it. Only a full page reload clears it.
// The fix
await authClient.signOut();
window.location.href = "/login"; // full reload — not router.pushOne line of difference. Fundamentally different behavior.
router.push: client-side navigation, cache intact.
window.location.href: full reload, everything starts from zero.
For an app with financial or personal data — this is non-negotiable.