Skip to content

Kirby 3.5.7.1

$user->logout()

Logs the user out

$user->logout(\Kirby\Session\Session|array|null $session = null): void

Parameters

Name Type Default Description
$session Kirby\Session\Session|array|null null Session options or session object to unset the user in

Parent class

Kirby\Cms\User

Example

<?php

if($user = $kirby->user()) {
  $user->logout();
}

go('login');

?>