/**
  * @see sfWebController
  */
 public function redirect($url, $delay = 0, $statusCode = 302)
 {
     $url = $this->genUrl($url, true);
     if (!$this->context->getRequest()->isCookie()) {
         $matchd = '/' . preg_quote(session_name(), '/') . '=.*([&|#]?)/';
         if (preg_match($matchd, $url)) {
             $url = preg_replace($matchd, SID . '\\1', $url);
         } else {
             if (strpos($url, '?') !== false) {
                 $url .= '&';
             } else {
                 $url .= '?';
             }
             $url .= SID;
         }
     }
     parent::redirect($url, $delay, $statusCode);
 }
 /**
  * @see sfWebController
  */
 public function redirect($url, $delay = 0, $statusCode = 302)
 {
     // absolute URL or symfony URL?
     if (is_string($url) && preg_match('#^[a-z][a-z0-9\\+.\\-]*\\://#i', $url)) {
         return parent::redirect($url, $delay, $statusCode);
     }
     $url = $this->genUrl($url, true);
     if (!$this->context->getRequest()->isCookie()) {
         $matchd = '/' . preg_quote(session_name(), '/') . '=.*([&|#]?)/';
         if (preg_match($matchd, $url)) {
             $url = preg_replace($matchd, SID . '\\1', $url);
         } else {
             if (strpos($url, '?') !== false) {
                 $url .= '&';
             } else {
                 $url .= '?';
             }
             $url .= SID;
         }
     }
     parent::redirect($url, $delay, $statusCode);
 }