Update and Refetch Session
useSession() provides an update() method in supported v4 releases. Calling it refreshes session data; passing client data may trigger the update path. Treat all browser-supplied values as untrusted and validate them on the server. Avoid frequent polling unless your product needs it.
Refresh session
import { useSession } from "next-auth/react";
export default function RefreshSessionButton() {
const { update } = useSession();
return <button onClick={() => update()}>Refresh session</button>;
}Never accept a client-provided role or permission change without checking a trusted source.