// do not capture redirects or modify XML HTTP Requests
if($request->isXmlHttpRequest()){ return; }
if($response->headers->has('X-Debug-Token') && $response->isRedirect() && $this->interceptRedirects && 'html' === $request->getRequestFormat()){ if($request->hasSession()&&($session = $request->getSession())->isStarted() && $session->getFlashBag() instanceof AutoExpireFlashBag){ // keep current flashes for one more request if using AutoExpireFlashBag
$session->getFlashBag()->setAll($session->getFlashBag()->peekAll()); }