has('userid')) { $session->destroy(); $response = service('response'); $response->setHeader('Location', base_url('login')); $response->setStatusCode(302); return $response->send(); } } public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) { // Do something here } }