diff options
| author | 2015-08-01 10:35:54 +0200 | |
|---|---|---|
| committer | 2015-08-01 10:35:54 +0200 | |
| commit | 422a9e161b81a4ecf7ee9362a9e28d194dfef5ac (patch) | |
| tree | f7bf1a1216d1829128147f8089cdb9b21450de59 /lib | |
| parent | e5972938b5e327f9d234ea5df8d03e885274657d (diff) | |
| parent | 189e790f32d4e389cf1dc6da669a579717fff436 (diff) | |
Merge pull request #936 from Alkarex/MinzSessionCookie
Minz session cookie path bug (nginx?)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Minz/Session.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php index 058685ada..057e7746a 100644 --- a/lib/Minz/Session.php +++ b/lib/Minz/Session.php @@ -66,8 +66,10 @@ class Minz_Session { */ public static function keepCookie($l) { // Get the script_name (e.g. /p/i/index.php) and keep only the path. - $cookie_dir = empty($_SERVER['SCRIPT_NAME']) ? '' : $_SERVER['SCRIPT_NAME']; - $cookie_dir = dirname($cookie_dir); + $cookie_dir = empty($_SERVER['REQUEST_URI']) ? '/' : $_SERVER['REQUEST_URI']; + if (substr($cookie_dir, -1) !== '/') { + $cookie_dir = dirname($cookie_dir) . '/'; + } session_set_cookie_params($l, $cookie_dir, '', false, true); } |
