瀏覽代碼

changed the default httpOnly value for cookie for better security out of the box

Fabien Potencier 14 年之前
父節點
當前提交
17aa0ed0ed
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/Symfony/Component/BrowserKit/Cookie.php
  2. 1 1
      src/Symfony/Component/HttpFoundation/Cookie.php

+ 1 - 1
src/Symfony/Component/BrowserKit/Cookie.php

@@ -43,7 +43,7 @@ class Cookie
      *
      * @api
      */
-    public function __construct($name, $value, $expires = null, $path = '/', $domain = '', $secure = false, $httponly = false)
+    public function __construct($name, $value, $expires = null, $path = '/', $domain = '', $secure = false, $httponly = true)
     {
         $this->name     = $name;
         $this->value    = $value;

+ 1 - 1
src/Symfony/Component/HttpFoundation/Cookie.php

@@ -26,7 +26,7 @@ class Cookie
     protected $secure;
     protected $httpOnly;
 
-    public function __construct($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = false)
+    public function __construct($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true)
     {
         // from PHP source code
         if (preg_match("/[=,; \t\r\n\013\014]/", $name)) {