Fix cookie bug (#800)

+ small fixes
This commit is contained in:
RainLoop Team 2015-08-14 23:20:47 +04:00
parent 91f3c05d5e
commit 502aebdc37
7 changed files with 47 additions and 29 deletions

View file

@ -7,7 +7,7 @@ class Utils
/**
* @var string
*/
static $CookieDefaultPath = '/';
static $CookieDefaultPath = '';
static $Cookies = null;
@ -518,6 +518,7 @@ class Utils
if (null === $sPath)
{
$sPath = \RainLoop\Utils::$CookieDefaultPath;
$sPath = $sPath && 0 < \strlen($sPath) ? $sPath : null;
}
\RainLoop\Utils::$Cookies[$sName] = $sValue;
@ -531,8 +532,11 @@ class Utils
\RainLoop\Utils::$Cookies = is_array($_COOKIE) ? $_COOKIE : array();
}
$sPath = \RainLoop\Utils::$CookieDefaultPath;
$sPath = $sPath && 0 < \strlen($sPath) ? $sPath : null;
unset(\RainLoop\Utils::$Cookies[$sName]);
@\setcookie($sName, '', \time() - 3600 * 24 * 30);
@\setcookie($sName, '', \time() - 3600 * 24 * 30, $sPath);
}
/**