Skip to content

Kirby 6.0.0

$auth->currentUserFromSession()

Returns the logged in user by checking the current session and finding a valid user id in there

$auth->currentUserFromSession(Session|array|null $session = null): User|null

Parameters

Name Type Default
$session Kirby\Session\Sessionorarrayornull null

Return types

Kirby\Cms\Userornull

Parent class

Kirby\Auth\Auth