Skip to content

Kirby 5.0.4

$sessions->current()

Returns the current session based on the configured token transmission mode: - In cookie mode: Gets the session from the cookie - In header mode: Gets the session from the Authorization request header - In manual mode: Fails and throws an Exception

$sessions->current(): Kirby\Session\Session|null

Return types

Kirby\Session\Sessionornull

Either the current session or null in case there isn't one

This method modifies the existing $sessions object it is applied to and returns it again.

Exceptions

Parent class

Kirby\Session\Sessions