cookies->has(BigPipeStrategy::NOJS_COOKIE) || $request->getSession() === NULL) { throw new AccessDeniedHttpException(); } if (!$request->query->has('destination')) { throw new HttpException(400, 'The original location is missing.'); } $response = new LocalRedirectResponse($request->query->get('destination')); // Set cookie without httpOnly, so that JavaScript can delete it. $response->headers->setCookie(new Cookie(BigPipeStrategy::NOJS_COOKIE, TRUE, 0, '/', NULL, FALSE, FALSE)); $response->addCacheableDependency((new CacheableMetadata())->addCacheContexts(['cookies:' . BigPipeStrategy::NOJS_COOKIE, 'session.exists'])); return $response; } }