本文整理汇总了PHP中Symphony::Cookie方法的典型用法代码示例。如果您正苦于以下问题:PHP Symphony::Cookie方法的具体用法?PHP Symphony::Cookie怎么用?PHP Symphony::Cookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symphony
的用法示例。
在下文中一共展示了Symphony::Cookie方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialiseCookie
/**
* Setter for `$Cookie`. This will use PHP's parse_url
* function on the current URL to set a cookie using the cookie_prefix
* defined in the Symphony configuration. The cookie will last two
* weeks.
*
* This function also defines two constants, `__SYM_COOKIE_PATH__`
* and `__SYM_COOKIE_PREFIX__`.
*
* @deprecated Prior to Symphony 2.3.2, the constant `__SYM_COOKIE_PREFIX_`
* had a typo where it was missing the second underscore. Symphony will
* support both constants, `__SYM_COOKIE_PREFIX_` and `__SYM_COOKIE_PREFIX__`
* until Symphony 3.0
*/
public static function initialiseCookie()
{
$cookie_path = @parse_url(URL, PHP_URL_PATH);
$cookie_path = '/' . trim($cookie_path, '/');
define_safe('__SYM_COOKIE_PATH__', $cookie_path);
define_safe('__SYM_COOKIE_PREFIX_', self::Configuration()->get('cookie_prefix', 'symphony'));
define_safe('__SYM_COOKIE_PREFIX__', self::Configuration()->get('cookie_prefix', 'symphony'));
self::$Cookie = new Cookie(__SYM_COOKIE_PREFIX__, TWO_WEEKS, __SYM_COOKIE_PATH__);
}