Grav\Plugin\Admin\Admin::session PHP Method

session() public method

Get current session.
public session ( ) : RocketTheme\Toolbox\Session\Session
return RocketTheme\Toolbox\Session\Session
    public function session()
    {
        return $this->session;
    }

Usage Example

 /**
  * Handle logout.
  *
  * @return bool True if the action was performed.
  */
 protected function taskLogout()
 {
     $language = $this->grav['user']->authenticated ? $this->grav['user']->language : ($this->grav['language']->getLanguage() ?: 'en');
     $this->admin->session()->invalidate()->start();
     $this->setRedirect('/logout/lang:' . $language);
     return true;
 }
All Usage Examples Of Grav\Plugin\Admin\Admin::session