src/PeekAndPoke/Aviator/Session/Middleware/SessionStarterMiddleware.php
public function handle(ServerRequestInterface $request, ServerFrame $frame) : ResponseInterface
    {
        $this->session->start($request);

        $response = $frame->next($request);

        // if the session is started it will be written back and a cookie will be set
        if ($this->session->isStarted()) {
            $this->session->save();
            return $response->withHeader('Set-Cookie', 'aviator=' . $this->session->getId(). ';');
        }

        return $response;
    }
public function handle(ServerRequestInterface $request, ServerFrame $frame) : ResponseInterface
    {
        $this->session->start($request);

        $response = $frame->next($request);

        // if the session is started it will be written back and a cookie will be set
        if ($this->session->isStarted()) {
            $this->session->save();
            return $response->withHeader('Set-Cookie', 'aviator=' . $this->session->getId(). ';');
        }

        return $response;
    }
public function handle ( ServerRequestInterface $ request , ServerFrame $ frame ) : ResponseInterface { $ this -> session -> start ( $ request ) ; $ response = $ frame -> next ( $ request ) ; // if the session is started it will be written back and a cookie will be set if ( $ this -> session -> isStarted ( ) ) { $ this -> session -> save ( ) ; return $ response -> withHeader ( 'Set-Cookie' , 'aviator=' . $ this -> session -> getId ( ) . ';' ) ; } return $ response ; }
@param ServerRequestInterface $request
@param ServerFrame            $frame

@return ResponseInterface
@param ServerRequestInterface $request @param ServerFrame $frame