diff --git a/README.md b/README.md index 3a8b5c5..da08227 100755 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ They all act as a wrapper for the PHP `setcookie` function: More info: (http://php.net/manual/en/function.setcookie.php) -All of the parameters except for `NAME` are optional. +All of the parameters except for `NAME` are optional. The `DOMAIN` defaults to `/` **Examples** diff --git a/services/Cookies_UtilsService.php b/services/Cookies_UtilsService.php index 7352724..542af24 100644 --- a/services/Cookies_UtilsService.php +++ b/services/Cookies_UtilsService.php @@ -8,7 +8,7 @@ class Cookies_UtilsService extends BaseApplicationComponent Standard cookies -------------------------------------------------------------------------------- */ - public function set($name = "", $value = "", $expire = 0, $path = "", $domain = "", $secure = false, $httponly = false) + public function set($name = "", $value = "", $expire = 0, $path = "", $domain = "/", $secure = false, $httponly = false) { $expire = (int) $expire; /* -- Make sure the cookie expiry is in the past if we're deleting the cookie */ @@ -28,7 +28,7 @@ public function get($name = "") Security validated cookies -------------------------------------------------------------------------------- */ - public function setSecure($name = "", $value = "", $expire = 0, $path = "", $domain = "", $secure = false, $httponly = false) + public function setSecure($name = "", $value = "", $expire = 0, $path = "", $domain = "/", $secure = false, $httponly = false) { if ($name == "") {