浏览代码

Update Response.php

walkor 3 年之前
父节点
当前提交
700e72a214
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Protocols/Http/Response.php

+ 2 - 2
src/Protocols/Http/Response.php

@@ -333,11 +333,11 @@ class Response
      * @param bool $same_site
      * @return $this
      */
-    public function cookie($name, $value = '', $max_age = 0, $path = '', $domain = '', $secure = false, $http_only = false, $same_site = false)
+    public function cookie($name, $value = '', $max_age = null, $path = '', $domain = '', $secure = false, $http_only = false, $same_site  = false)
     {
         $this->_header['Set-Cookie'][] = $name . '=' . \rawurlencode($value)
             . (empty($domain) ? '' : '; Domain=' . $domain)
-            . (empty($max_age) ? '' : '; Max-Age=' . $max_age)
+            . ($max_age === null ? '' : '; Max-Age=' . $max_age)
             . (empty($path) ? '' : '; Path=' . $path)
             . (!$secure ? '' : '; Secure')
             . (!$http_only ? '' : '; HttpOnly')