Skip to content

Kirby 6.0.0

$sessions->get()

Returns the automatic session for the current request, creating a new one on demand if none exists yet

$sessions->get(array $options = []): Session

Parameters

Name Type Default Description
$options array [] Optional additional options: - detect: Whether to allow sessions in the Authorization HTTP header (true) or only in the session cookie (false); defaults to false - createMode: When creating a new session, should it be set as a cookie or is it going to be transmitted manually to be used in a header?; defaults to cookie - long: Whether the session is a long "remember me" session or a normal session; defaults to false

Return type

Kirby\Session\Session

Parent class

Kirby\Session\Sessions