diff options
| author | 2018-12-27 22:57:30 +0100 | |
|---|---|---|
| committer | 2018-12-27 22:57:30 +0100 | |
| commit | e9d50f48eb376766ebdb4a7d7e10d15bf863d5a7 (patch) | |
| tree | 54a58fb08802e7b6e5ae3f9d9c797da4ee526b81 /lib/Minz/Session.php | |
| parent | 06ea2626e804dd24c2d84fa26c8febf29ef3d357 (diff) | |
HTTP_X_FORWARDED_PREFIX for cookie path (#2201)
Forgotten. Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2191
Diffstat (limited to 'lib/Minz/Session.php')
| -rw-r--r-- | lib/Minz/Session.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php index c94f2b646..97b15c4d0 100644 --- a/lib/Minz/Session.php +++ b/lib/Minz/Session.php @@ -61,7 +61,11 @@ class Minz_Session { public static function getCookieDir() { // Get the script_name (e.g. /p/i/index.php) and keep only the path. - $cookie_dir = empty($_SERVER['REQUEST_URI']) ? '/' : $_SERVER['REQUEST_URI']; + $cookie_dir = ''; + if (!empty($_SERVER['HTTP_X_FORWARDED_PREFIX'])) { + $cookie_dir .= rtrim($_SERVER['HTTP_X_FORWARDED_PREFIX'], '/ '); + } + $cookie_dir .= empty($_SERVER['REQUEST_URI']) ? '/' : $_SERVER['REQUEST_URI']; if (substr($cookie_dir, -1) !== '/') { $cookie_dir = dirname($cookie_dir) . '/'; } |
