本文整理汇总了PHP中Cookie::toString方法的典型用法代码示例。如果您正苦于以下问题:PHP Cookie::toString方法的具体用法?PHP Cookie::toString怎么用?PHP Cookie::toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRequestVar
if ($java == -1) {
$javascript = 0;
$java = 0;
} else {
$javascript = 1;
}
$refererUrl = getRequestVar('ref', '');
$typeTag = getRequestVar('type', "", 'string');
$site = new Site($idSite);
// debug cookie
if (PRINT_ALL_COOKIES_CONTENT) {
require_once INCLUDE_PATH . "/core/include/DataModel.class.php";
$sitesId = $site->getSitesId();
foreach ($sitesId as $sid) {
$c = new Cookie(COOKIE_PMVLOG_NAME . $sid);
print $c->toString();
}
exit;
} else {
if (PRINT_COOKIE_CONTENT) {
print $GLOBALS['cookie']->toString();
exit;
}
}
/*
* site urls
*/
// commented in 2.3b3 because its actually not used
//if(!$siteUrls = $GLOBALS['cookie']->getVar('site_urls'))
//{
// $siteUrlsBefore = $site->getUrls();
示例2: testConstructorFull
public function testConstructorFull()
{
$cookie = new Cookie('foo', 'bar', new \DateTime('2015-04-26'), '/', 'foo.com', true, true);
$this->assertEquals('foo=bar; Expires=Sun, 26 Apr 2015 00:00:00 GMT; Path=/; Domain=foo.com; Secure; HttpOnly', $cookie->toString());
}
示例3: setCookie
/**
* Sets a Cookie.
*
* <code>
* $response->setCookie(new Cookie("Foo", "Bar"));
* </code>
*
* @param Cookie Cookie
* @see Cookie
*/
public function setCookie(Cookie $cookie)
{
$this->setHeader('Set-Cookie', $cookie->toString());
}