From: jakubvrana Date: Fri, 18 Dec 2009 17:59:58 +0000 (+0000) Subject: Secure cookies X-Git-Tag: v3.0.0~265 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=c2334dbc679f022a286dc25f0293de2998d2be4d;p=adminer.git Secure cookies git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1283 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- 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