Fix set cookie with tag "secure" when https is forced.
This commit is contained in:
parent
928a2154b3
commit
841176fdfd
@ -265,7 +265,7 @@ if (!empty($_POST["DOL_AUTOSET_COOKIE"])) {
|
|||||||
$cookiename = $tmpautoset[0];
|
$cookiename = $tmpautoset[0];
|
||||||
$cookievalue = json_encode($cookiearrayvalue);
|
$cookievalue = json_encode($cookiearrayvalue);
|
||||||
//var_dump('setcookie cookiename='.$cookiename.' cookievalue='.$cookievalue);
|
//var_dump('setcookie cookiename='.$cookiename.' cookievalue='.$cookievalue);
|
||||||
setcookie($cookiename, empty($cookievalue) ? '' : $cookievalue, empty($cookievalue) ? 0 : (time() + (86400 * 354)), '/', null, false, true); // keep cookie 1 year and add tag httponly
|
setcookie($cookiename, empty($cookievalue) ? '' : $cookievalue, empty($cookievalue) ? 0 : (time() + (86400 * 354)), '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // keep cookie 1 year and add tag httponly
|
||||||
if (empty($cookievalue)) {
|
if (empty($cookievalue)) {
|
||||||
unset($_COOKIE[$cookiename]);
|
unset($_COOKIE[$cookiename]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ if ($_SESSION["takeposterminal"] == "") {
|
|||||||
|
|
||||||
if ($setterminal > 0) {
|
if ($setterminal > 0) {
|
||||||
$_SESSION["takeposterminal"] = $setterminal;
|
$_SESSION["takeposterminal"] = $setterminal;
|
||||||
setcookie("takeposterminal", $setterminal, (time() + (86400 * 354)), '/', null, false, true); // Permanent takeposterminal var in a cookie
|
setcookie("takeposterminal", $setterminal, (time() + (86400 * 354)), '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Permanent takeposterminal var in a cookie
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($setcurrency != "") {
|
if ($setcurrency != "") {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user