public function generateAuthResponse(Application $app, \Browser $browser, $redirect) { if ($browser->isMobile()) { $response = $app->redirectPath('lightbox'); } elseif ($redirect) { $response = new RedirectResponse('../' . ltrim($redirect, '/')); } elseif (true !== $browser->isNewGeneration()) { $response = $app->redirectPath('get_client'); } else { $response = $app->redirectPath('prod'); } $response->headers->clearCookie('postlog'); $response->headers->clearCookie('last_act'); return $response; }