改进Cookie类

This commit is contained in:
thinkphp
2016-05-23 16:03:37 +08:00
parent 9879f9e59e
commit c4123537ef
2 changed files with 23 additions and 0 deletions

View File

@@ -37,6 +37,9 @@ class Cookie
*/
public static function init(array $config = [])
{
if (empty($config)) {
$config = Config::get('session');
}
self::$config = array_merge(self::$config, array_change_key_case($config));
if (!empty(self::$config['httponly'])) {
ini_set('session.cookie_httponly', 1);