改进cookie函数支持有效期传入

This commit is contained in:
thinkphp
2016-03-27 10:43:17 +08:00
parent d8e062dbbe
commit b26b7934a8

View File

@@ -220,7 +220,7 @@ function session($name, $value = '', $prefix = null)
}
}
function cookie($name, $value = '')
function cookie($name, $value = '', $option = null)
{
if (is_array($name)) {
// 初始化
@@ -236,7 +236,7 @@ function cookie($name, $value = '')
return \think\Cookie::delete($name);
} else {
// 设置session
return \think\Cookie::set($name, $value);
return \think\Cookie::set($name, $value, $option);
}
}