[icinga-checkins] icinga.org: icingaweb2/master: Ensure trailing slash if cookie path is detected automatically

git at icinga.org git at icinga.org
Sat Feb 27 22:50:04 CET 2016


Module: icingaweb2
Branch: master
Commit: 03d7f3a1f4542880afee19833dde019f65c30612
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=03d7f3a1f4542880afee19833dde019f65c30612

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Sat Feb 27 22:42:32 2016 +0100

Ensure trailing slash if cookie path is detected automatically

Seems like IE (8, 9, ?) has problems w/o the trailing slash and additional directories on the server that start w/ the path.

refs #11187

---

 library/Icinga/Web/Cookie.php |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/library/Icinga/Web/Cookie.php b/library/Icinga/Web/Cookie.php
index 54ad307..79ebe2d 100644
--- a/library/Icinga/Web/Cookie.php
+++ b/library/Icinga/Web/Cookie.php
@@ -185,9 +185,9 @@ class Cookie
             if ($path === null) {
                 // The following call could be used as default for ConfigObject::get(), but we prevent unnecessary
                 // function calls here, if the path is set in the config
-                $path = Icinga::app()->getRequest()->getBaseUrl();
+                $path = Icinga::app()->getRequest()->getBaseUrl() . '/'; // Zend has rtrim($baseUrl, '/')
             }
-            return $path;
+            $this->path = $path;
         }
         return $this->path;
     }
@@ -222,7 +222,7 @@ class Cookie
                 // function calls here, if the secure flag is set in the config
                 $secure = Icinga::app()->getRequest()->isSecure();
             }
-            return $secure;
+            $this->secure = $secure;
         }
         return $this->secure;
     }



More information about the icinga-checkins mailing list