/**
  * @param ServerRequestInterface $request
  * @param ResponseInterface $response
  * @param callable|null $next
  * @return ResponseInterface
  */
 public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
 {
     if (!$this->session->isStarted()) {
         $this->session->start();
     }
     $request = $request->withAttribute('session', $this->session);
     if ($next) {
         return $next($request, $response);
     }
     return $response;
 }
Exemple #2
0
 /**
  * Set a property in the session bucket
  *
  * @param   string  $key    The key
  * @param   mixed   $value  The value
  *
  * @return  void
  */
 public function set($key, $value)
 {
     $this->session->getSegment('Joomla')->set($key, $value);
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function clear($identifier)
 {
     $this->session->clear();
 }
Exemple #4
0
 /**
  *
  */
 public function destroySession()
 {
     $this->session->destroy();
 }