Secure cookies
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1283 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
8474399a40
commit
c2334dbc67
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue