/** * Get a default session value, if any is available * * @return SessionInterface|null A default session value or Null if no default value is available */ public function getDefaultSession() { // By default, the Session Facade does not return the // any actual session instance, but rather an // instance of \Illuminate\Session\SessionManager. // Therefore, we make sure only to obtain its // "driver", to make sure that its only the connection // instance that we obtain. $manager = Session::getFacadeRoot(); if (!is_null($manager)) { return $manager->driver(); } return $manager; }
/** * Get a default session manager value, if any is available * * @return SessionManager|null A default session manager value or Null if no default value is available */ public function getDefaultSessionManager() { return Session::getFacadeRoot(); }