Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make session handler accessible
Fixes #2294.
  • Loading branch information
lukasbestle authored and bastianallgeier committed Nov 26, 2019
1 parent cf25702 commit 0fed132
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Cms/App.php
Expand Up @@ -67,7 +67,7 @@ class App
protected $routes;
protected $router;
protected $server;
protected $session;
protected $sessionHandler;
protected $site;
protected $system;
protected $urls;
Expand Down Expand Up @@ -1106,8 +1106,18 @@ public function routes(): array
*/
public function session(array $options = [])
{
$this->session = $this->session ?? new AutoSession($this->root('sessions'), $this->options['session'] ?? []);
return $this->session->get($options);
return $this->sessionHandler()->get($options);
}

/**
* Returns the session handler
*
* @return \Kirby\Session\AutoSession
*/
public function sessionHandler()
{
$this->sessionHandler = $this->sessionHandler ?? new AutoSession($this->root('sessions'), $this->option('session', []));
return $this->sessionHandler;
}

/**
Expand Down

0 comments on commit 0fed132

Please sign in to comment.