Permalink
Browse files

Improve handling of session.auto_start

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1224 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent 807de59 commit dfb36a693f0758e5d30dcfc33ab9cb97d5d5228b jakubvrana committed Nov 2, 2009
Showing with 8 additions and 9 deletions.
  1. +8 −9 adminer/include/bootstrap.inc.php
@@ -43,16 +43,15 @@
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"] . (strlen($_SERVER["QUERY_STRING"]) ? "?$_SERVER[QUERY_STRING]" : "");
}
-if (!ini_get("session.auto_start")) {
- @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
- $params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $_SERVER["HTTPS"]);
- if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
- $params[] = true; // HttpOnly
- }
- call_user_func_array('session_set_cookie_params', $params);
- session_start();
+session_write_close(); // disable session.auto_start
+@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
+$params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $_SERVER["HTTPS"]);
+if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
+ $params[] = true; // HttpOnly
}
+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
if (get_magic_quotes_gpc()) {

0 comments on commit dfb36a6

Please sign in to comment.