本文整理汇总了PHP中sfWebRequest::getCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP sfWebRequest::getCookie方法的具体用法?PHP sfWebRequest::getCookie怎么用?PHP sfWebRequest::getCookie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfWebRequest
的用法示例。
在下文中一共展示了sfWebRequest::getCookie方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeIndex
public function executeIndex(sfWebRequest $request)
{
$updated = strtotime('May 8, 2010 8:50 am');
$cookie = $request->getCookie('donateNashville');
if (!$cookie || $cookie != $updated) {
$this->getResponse()->setCookie("donateNashville", $updated, time() + 150000000);
$this->showPopUp = true;
}
}
示例2: isLoggedIn
public static function isLoggedIn(sfWebRequest $request)
{
// FIXME may also need to check what type of user it is
return $request->getCookie("username");
}
示例3: __construct
public function __construct($formName, $actionUrl, sfWebRequest $request)
{
$this->_formName = $formName;
$this->_actionUrl = $actionUrl;
$this->_sid = $request->getCookie("sid", -1);
}
示例4: isLoggedIn
public static function isLoggedIn(sfWebRequest $request)
{
return $request->getCookie("username") && $request->getCookie("sid");
}
示例5: getCookieContent
/**
* Reads the poll's visibility cookie and returns its value.
*
* @param sfWebRequest $request
* @return type
*/
static function getCookieContent(sfWebRequest $request)
{
$cookie = $request->getCookie(self::getCookieName());
return null !== $cookie ? self::decodeFromCookie($cookie) : array();
}