diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index dba76517..279abd37 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -201,7 +201,11 @@ function where_link($i, $column, $value) { * @return bool */ function cookie($name, $value) { - return setcookie($name, $value, time() + 2592000, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"])); // 2592000 = 30 * 24 * 60 * 60 + $params = array($name, $value, time() + 2592000, preg_replace('~\\?.*~', '', ME), "", (bool) $_SERVER["HTTPS"]); // 2592000 = 30 * 24 * 60 * 60 + if (version_compare(PHP_VERSION, '5.2.0') >= 0) { + $params[] = true; // HttpOnly + } + return call_user_func_array('setcookie', $params); } /** Restart stopped session