mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进cookie函数支持有效期传入
This commit is contained in:
@@ -220,7 +220,7 @@ function session($name, $value = '', $prefix = null)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function cookie($name, $value = '')
|
function cookie($name, $value = '', $option = null)
|
||||||
{
|
{
|
||||||
if (is_array($name)) {
|
if (is_array($name)) {
|
||||||
// 初始化
|
// 初始化
|
||||||
@@ -236,7 +236,7 @@ function cookie($name, $value = '')
|
|||||||
return \think\Cookie::delete($name);
|
return \think\Cookie::delete($name);
|
||||||
} else {
|
} else {
|
||||||
// 设置session
|
// 设置session
|
||||||
return \think\Cookie::set($name, $value);
|
return \think\Cookie::set($name, $value, $option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user