mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
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];
|
||||
$cookievalue = json_encode($cookiearrayvalue);
|
||||
//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)) {
|
||||
unset($_COOKIE[$cookiename]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ if ($_SESSION["takeposterminal"] == "") {
|
|||
|
||||
if ($setterminal > 0) {
|
||||
$_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 != "") {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user