Skip to content

Commit

Permalink
Improve handling of session.auto_start
Browse files Browse the repository at this point in the history
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1224 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information
jakubvrana committed Nov 2, 2009
1 parent 807de59 commit dfb36a6
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions adminer/include/bootstrap.inc.php
Expand Up @@ -43,16 +43,15 @@
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"] . (strlen($_SERVER["QUERY_STRING"]) ? "?$_SERVER[QUERY_STRING]" : ""); $_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"] . (strlen($_SERVER["QUERY_STRING"]) ? "?$_SERVER[QUERY_STRING]" : "");
} }


if (!ini_get("session.auto_start")) { session_write_close(); // disable session.auto_start
@ini_set("session.use_trans_sid", false); // protect links in export, @ - may be disabled @ini_set("session.use_trans_sid", false); // protect links in export, @ - may be disabled
session_name("adminer_sid"); // use specific session name to get own namespace session_name("adminer_sid"); // use specific session name to get own namespace
$params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $_SERVER["HTTPS"]); $params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $_SERVER["HTTPS"]);
if (version_compare(PHP_VERSION, '5.2.0') >= 0) { if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
$params[] = true; // HttpOnly $params[] = true; // HttpOnly
}
call_user_func_array('session_set_cookie_params', $params);
session_start();
} }
call_user_func_array('session_set_cookie_params', $params); // ini_set() may be disabled
session_start();


// disable magic quotes to be able to use database escaping function // disable magic quotes to be able to use database escaping function
if (get_magic_quotes_gpc()) { if (get_magic_quotes_gpc()) {
Expand Down

0 comments on commit dfb36a6

Please sign in to comment.