本文整理匯總了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();
}