Two layers are holding on to the old state: the Next.js client-side router cache (server components rendered earlier are reused on client navigation) and whatever client state you keep.
Cleanest fix: do the logout on the server and tell Next the rendered output is stale.
// app/actions/auth.ts
'use server'
import { revalidatePath } from 'next/cache'
import { redirect } from 'next/navigation'
export async function logout() {
const supabase = await createClient()
await supabase.auth.signOut()
revalidatePath('/', 'layout')
redirect('/')
}The button becomes <form action={logout}><button>Log out</button></form>.
If you keep a client-side logout, call router.refresh() after signOut() instead of only router.push. That refetches the server components with the new (empty) cookies.