diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e7fa5e33e39..49797b1e6e8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -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]); } diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 1ddab39dcbe..e7b8b8af438 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -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 != "") {