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;
  }