From c2334dbc679f022a286dc25f0293de2998d2be4d Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Fri, 18 Dec 2009 17:59:58 +0000 Subject: [PATCH] Secure cookies git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1283 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/functions.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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