Adds a cookie to the response.
Definition at line 82 of file class_HttpResponse.php. References BaseFrameworkSystem.getConfigInstance(). Referenced by expireCookie(), and refreshCookie(). 00082 { 00083 //* DEBUG: */ echo $cookieName."=".$cookieValue."<br />\n"; 00084 // Are headers already sent? 00085 if (headers_sent()) { 00086 // Throw an exception here 00087 //* DEBUG: */ return; 00088 throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT); 00089 } // END - if 00090 00091 // Shall we encrypt the cookie? 00092 if ($encrypted === true) { 00093 } // END - if 00094 00095 // For slow browsers set the cookie array element first 00096 $_COOKIE[$cookieName] = $cookieValue; 00097 00098 // Get all config entries 00099 if (is_null($expires)) { 00100 $expires = (time() + $this->getConfigInstance()->readConfig('cookie_expire')); 00101 } // END - if 00102 00103 $path = $this->getConfigInstance()->readConfig('cookie_path'); 00104 $domain = $this->getConfigInstance()->readConfig('cookie_domain'); 00105 00106 setcookie($cookieName, $cookieValue, $expires); 00107 //, $path, $domain, (isset($_SERVER['HTTPS'])) 00108 return; 00109 00110 // Now construct the full header 00111 $cookieString = $cookieName . "=" . $cookieValue . "; "; 00112 $cookieString .= "expires=" . date("D, d-F-Y H:i:s", $expires) . " GMT"; 00113 // $cookieString .= "; path=".$path."; domain=".$domain; 00114 00115 // Set the cookie as a header 00116 $this->cookies[$cookieName] = $cookieString; 00117 }
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]()
|
1.5.6