diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2010-03-16 14:12:09 +0300 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2010-03-16 14:12:09 +0300 |
commit | 37c5c0749bba33f3452d16fd41bdea6bd4c0c0cc (patch) | |
tree | 6e7bd489cfa70a26210854c05172c12e9236dcce /core/Cookie.php | |
parent | 746f15852ded2e115256a3a858f79cc8e60c9fbc (diff) |
Fixes #1155 Cookie path can now be defined in config file
git-svn-id: http://dev.piwik.org/svn/trunk@1927 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Cookie.php')
-rw-r--r-- | core/Cookie.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/Cookie.php b/core/Cookie.php index c688cf09eb..26eee20f34 100644 --- a/core/Cookie.php +++ b/core/Cookie.php @@ -46,11 +46,12 @@ class Piwik_Cookie * * @param string cookie Name * @param int The timestamp after which the cookie will expire, eg time() + 86400 + * @param string The path on the server in which the cookie will be available on. */ - public function __construct( $cookieName, $expire = null) + public function __construct( $cookieName, $expire = null, $path = null) { $this->name = $cookieName; - + $this->path = $path; $this->expire = $expire; if(is_null($expire) || !is_numeric($expire) @@ -59,6 +60,7 @@ class Piwik_Cookie $this->expire = $this->getDefaultExpire(); } + if($this->isCookieFound()) { $this->loadContentFromCookie(); @@ -139,7 +141,7 @@ class Piwik_Cookie public function save() { $this->setP3PHeader(); - $this->setCookie( $this->name, $this->generateContentString(), $this->expire); + $this->setCookie( $this->name, $this->generateContentString(), $this->expire, $this->path); } /** |