$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
Example
<?php
if($user = $kirby->user()) {
$user->logout();
}
go('login');
?>