本文整理汇总了PHP中Q_Response::cookies方法的典型用法代码示例。如果您正苦于以下问题:PHP Q_Response::cookies方法的具体用法?PHP Q_Response::cookies怎么用?PHP Q_Response::cookies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q_Response
的用法示例。
在下文中一共展示了Q_Response::cookies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendCookieHeaders
/**
* Outputs all the headers for effecting changes in cookies set by Q_Response::setCookies.
* This is called automatically by the dispatcher before the Q/response event.
* @method sendCookieHeaders
* @static
*/
static function sendCookieHeaders()
{
if (empty(self::$cookies)) {
return;
}
foreach (self::$cookies as $name => $args) {
list($value, $expires, $path) = $args;
self::_cookie($name, $value, $expires, $path);
}
// A reasonable P3P policy for old IE to allow 3rd party cookies.
// Consider overriding it with a real P3P policy for your app.
$header = 'P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"';
$header = Q::event('Q/Response/setCookie', compact('name', 'value', 'expires', 'path', 'header'), 'before', false, $header);
header($header);
self::$cookies = array();
}