setCookie() public method

Sets a cookie.
public setCookie ( string $name, string $value, string $expire = null, string $path = '/', string $domain = '', boolean $secure = false, boolean $httpOnly = false )
$name string HTTP header name
$value string Value for the cookie
$expire string Cookie expiration period
$path string Path
$domain string Domain name
$secure boolean If secure
$httpOnly boolean If uses only HTTP
 /**
  *  Saves the visibility option of a poll in a cookie.
  * 
  * @param sfWebRequest $request
  * @param sfWebResponse $response
  * @param aPollPoll $poll
  * @param type $value
  * @throws sfException 
  */
 static function setShowPollToCookie(sfWebRequest $request, sfWebResponse $response, aPollPoll $poll, $value)
 {
     $id = $poll->getId();
     $cookie = self::getCookieContent($request);
     if (!($value === true || $value === false)) {
         throw new sfException(__FUNCTION__ . ' only accepts "true" and "false" as values.');
     }
     $cookie = array_merge($cookie, array($id => array('show' => $value, 'timeout' => time() + self::getCookieLifetime($poll))));
     $response->setCookie(self::getCookieName(), self::encodeForCookie($cookie), time() + self::getCookieLifetime($poll));
 }