webserver.php
changeset 63 af239423ed15
parent 62 1b73be5346df
child 64 ee64bb096f56
equal deleted inserted replaced
62:1b73be5346df 63:af239423ed15
  1433   
  1433   
  1434   function setcookie($cookiename, $cookievalue, $expiry = false, $path = false, $domain = false, $secure = false, $httponly = false)
  1434   function setcookie($cookiename, $cookievalue, $expiry = false, $path = false, $domain = false, $secure = false, $httponly = false)
  1435   {
  1435   {
  1436     $header = "Set-Cookie: $cookiename=$cookievalue";
  1436     $header = "Set-Cookie: $cookiename=$cookievalue";
  1437     if ( !empty($expiry) )
  1437     if ( !empty($expiry) )
  1438       $header .= "; expires=" . date('D, d-M-Y H:i:s T', $expiry);
  1438       $header .= "; expires=" . gmdate('D, d-M-Y H:i:s T', $expiry);
  1439     if ( !empty($path) )
  1439     if ( !empty($path) )
  1440       $header .= "; path=$path";
  1440       $header .= "; path=$path";
  1441     if ( !empty($domain) )
  1441     if ( !empty($domain) )
  1442       $header .= "; domain=$domain";
  1442       $header .= "; domain=$domain";
  1443     if ( $secure )
  1443     if ( $secure )
  1453     {
  1453     {
  1454       $_COOKIE[$cookiename] = $cookievalue;
  1454       $_COOKIE[$cookiename] = $cookievalue;
  1455     }
  1455     }
  1456     
  1456     
  1457     $this->header($header);
  1457     $this->header($header);
       
  1458     return $header;
  1458   }
  1459   }
  1459   
  1460   
  1460   /**
  1461   /**
  1461    * Sends the client an HTTP error page
  1462    * Sends the client an HTTP error page
  1462    * @param resource Socket connection to client
  1463    * @param resource Socket connection to client