summaryrefslogtreecommitdiffstats
path: root/lib/private/appframework/http
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-10-06 15:24:19 +0200
committerLukas Reschke <lukas@owncloud.com>2015-10-06 15:24:19 +0200
commit6a4f22c61f58b80f826408780d6882f0d1041e70 (patch)
tree141104ccb4b0deae788124daf43d69202b3f4fb4 /lib/private/appframework/http
parent191f1b2d49afe980f43bdf6c0cc2c8cbb7f88c91 (diff)
downloadnextcloud-server-6a4f22c61f58b80f826408780d6882f0d1041e70.tar.gz
nextcloud-server-6a4f22c61f58b80f826408780d6882f0d1041e70.zip
Use `/` if installed in main folder
Otherwise an empty string is used indicating the cookie is only valid for those resources. This can lead to eunexpected behaviour. Fixes https://github.com/owncloud/core/issues/19196
Diffstat (limited to 'lib/private/appframework/http')
-rw-r--r--lib/private/appframework/http/output.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/private/appframework/http/output.php b/lib/private/appframework/http/output.php
index f04157665f8..01636d397b2 100644
--- a/lib/private/appframework/http/output.php
+++ b/lib/private/appframework/http/output.php
@@ -27,6 +27,15 @@ use OCP\AppFramework\Http\IOutput;
* Very thin wrapper class to make output testable
*/
class Output implements IOutput {
+ /** @var string */
+ private $webRoot;
+
+ /**
+ * @param $webRoot
+ */
+ public function __construct($webRoot) {
+ $this->webRoot = $webRoot;
+ }
/**
* @param string $out
@@ -72,10 +81,11 @@ class Output implements IOutput {
* @param string $path
* @param string $domain
* @param bool $secure
- * @param bool $httponly
+ * @param bool $httpOnly
*/
- public function setCookie($name, $value, $expire, $path, $domain, $secure, $httponly) {
- setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
+ public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly) {
+ $path = $this->webRoot ? : '/';
+ setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
}
}