aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/functions_session.inc.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/functions_session.inc.php b/include/functions_session.inc.php
index 9768bf927..8765028ae 100644
--- a/include/functions_session.inc.php
+++ b/include/functions_session.inc.php
@@ -84,7 +84,12 @@ if (isset($conf['session_save_handler'])
// cookie_path will return : "/meeting/gallery"
function cookie_path()
{
- if ( isset($_SERVER['REDIRECT_URL']) )
+ if ( isset($_SERVER['REDIRECT_SCRIPT_NAME']) and
+ !empty($_SERVER['REDIRECT_SCRIPT_NAME']) )
+ {
+ $scr = $_SERVER['REDIRECT_SCRIPT_NAME'];
+ }
+ else if ( isset($_SERVER['REDIRECT_URL']) )
{ // mod_rewrite is activated for upper level directories. we must set the
// cookie to the path shown in the browser otherwise it will be discarded.
if ( isset($_SERVER['PATH_INFO']) and !empty($_SERVER['PATH_INFO']) )
@@ -108,7 +113,9 @@ function cookie_path()
{
$scr = $_SERVER['SCRIPT_NAME'];
}
- return substr($scr,0,strrpos( $scr,'/'));
+ $scr = substr($scr,0,strrpos( $scr,'/'));
+ // add a trailing '/' if needed
+ return ($scr{strlen($scr)-1} == '/') ? $scr : $scr . '/';
}
/**