mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
Cookie类增加forever方法用于永久缓存
This commit is contained in:
@@ -99,6 +99,22 @@ class Cookie
|
|||||||
$_COOKIE[$name] = $value;
|
$_COOKIE[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 永久保存Cookie数据
|
||||||
|
* @param string $name cookie名称
|
||||||
|
* @param mixed $value cookie值
|
||||||
|
* @param mixed $option 可选参数 可能会是 null|integer|string
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function forever($name, $value = '', $option = null)
|
||||||
|
{
|
||||||
|
if (is_null($option) || is_numeric($option)) {
|
||||||
|
$option = [];
|
||||||
|
}
|
||||||
|
$option['expire'] = 315360000;
|
||||||
|
self::set($name, $value, $option);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断Cookie数据
|
* 判断Cookie数据
|
||||||
* @param string $name cookie名称
|
* @param string $name cookie名称
|
||||||
|
|||||||
Reference in New Issue
Block a user