Logout / Revoke Session
revokeSession
function: API Reference
$session->revokeSession()
- This function deletes the session from the database and clears relevant auth cookies
- If using blacklisting, this will immediately invalidate the JWT access token.
Example
Route::middleware("supertokens.middleware")->post("/logout", function (Request $request) {
$session = $request->supertokens;
$session->revokeSession();
return "Success! Go to login page";
});