src/ieu/Http/Request.php
public function session(string $key, $default = null)
  {
    if (null === $this->session) {
      throw new \Exception('No session object set. Use \'Request::setSession\'.');
    }

    return $this->session->has($key) ? $this->session->get($key) : $default;
  }
public function session(string $key, $default = null)
  {
    if (null === $this->session) {
      throw new \Exception('No session object set. Use \'Request::setSession\'.');
    }

    return $this->session->has($key) ? $this->session->get($key) : $default;
  }
public function session ( string $ key , $ default = null ) { if ( null === $ this -> session ) { throw new \ Exception ( 'No session object set. Use \'Request::setSession\'.' ) ; } return $ this -> session -> has ( $ key ) ? $ this -> session -> get ( $ key ) : $ default ; }
Shortcut to fetch a SESSION-parameter with optional default value.
The session object must me manualy set and started!

@param string $key
the key to look for
@param mixed $default
the value thar will be returned if the key is not set

@return mixed
the found or the default value
Shortcut to fetch a SESSION - parameter with optional default value . The session object must me manualy set and started!