Skip to content

Commit

Permalink
改进cookie函数支持有效期传入
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Mar 27, 2016
1 parent d8e062d commit b26b793
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function session($name, $value = '', $prefix = null)
}
}

function cookie($name, $value = '')
function cookie($name, $value = '', $option = null)
{
if (is_array($name)) {
// 初始化
Expand All @@ -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);
}
}

Expand Down

0 comments on commit b26b793

Please sign in to comment.