From cc8255139537dacf3ab0daa7d61867ab5774e07a Mon Sep 17 00:00:00 2001 From: chriskl Date: Wed, 10 Sep 2003 01:55:52 +0000 Subject: [PATCH] support sessions for browser with no cookies --- browser.php | 15 +++++++++------ libraries/lib.inc.php | 10 ++++++---- logout.php | 8 +++++--- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/browser.php b/browser.php index 00acddcd..d42ae0a7 100644 --- a/browser.php +++ b/browser.php @@ -5,7 +5,7 @@ * if you click on a database it shows a list of database objects in that * database. * - * $Id: browser.php,v 1.17 2003/08/26 05:59:49 chriskl Exp $ + * $Id: browser.php,v 1.18 2003/09/10 01:55:52 chriskl Exp $ */ // Include application functions @@ -22,7 +22,7 @@ $menu = new HTML_TreeMenu(null, array('usePersistence' => false)); $root = new HTML_TreeNode(array( 'text' => addslashes($misc->printVal(($conf['servers'][$_SESSION['webdbServerID']]['desc']))), - 'link' => 'all_db.php', + 'link' => 'all_db.php?' . SID, 'icon' => 'folder.gif', 'expandedIcon' => 'folder-expanded.gif', 'expanded' => true, @@ -38,6 +38,9 @@ function addNodes(&$schemanode, $querystr) { global $data, $localData, $misc, $lang, $conf; + // Session tracking + $querystr .= '&' . SID; + // Tables if ($data->hasTables()) { $table_node = &new HTML_TreeNode(array( @@ -154,7 +157,7 @@ if (isset($_REQUEST['database']) && $_REQUEST['database'] == $databases->f[$data->dbFields['dbname']]) { $db_node = &new HTML_TreeNode(array( 'text' => addslashes($misc->printVal($databases->f[$data->dbFields['dbname']])), - 'link' => addslashes(htmlspecialchars('database.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]))), + 'link' => addslashes(htmlspecialchars('database.php?database=' . urlencode($databases->f[$data->dbFields['dbname']]) . '&' . SID)), 'icon' => "../../../images/themes/{$conf['theme']}/database.png", 'expandedIcon' => "../../../images/themes/{$conf['theme']}/database.png", 'expanded' => true, @@ -170,7 +173,7 @@ urlencode($schemas->f[$data->nspFields['nspname']]); $schemanode = &new HTML_TreeNode(array( 'text' => addslashes($misc->printVal($schemas->f[$data->nspFields['nspname']])), - 'link' => addslashes(htmlspecialchars("schema.php?{$querystr}")), + 'link' => addslashes(htmlspecialchars("schema.php?{$querystr}&" . SID)), 'icon' => 'folder.gif', 'expandedIcon' => 'folder-expanded.gif', // Auto-expand your personal schema, if it exists. Also expand schema if there is @@ -190,7 +193,7 @@ // Database doesn't support schemas else { // Construct database query string - $querystr = 'database=' . urlencode($databases->f[$data->dbFields['dbname']]); + $querystr = 'database=' . urlencode($databases->f[$data->dbFields['dbname']]) . '&' . SID; addNodes($db_node, $querystr); } @@ -201,7 +204,7 @@ } else { $db_node = &new HTML_TreeNode(array( 'text' => addslashes($misc->printVal($databases->f[$data->dbFields['dbname']])), - 'link' => addslashes(htmlspecialchars("{$_SERVER['PHP_SELF']}?database=" . urlencode($databases->f[$data->dbFields['dbname']]))), + 'link' => addslashes(htmlspecialchars("{$_SERVER['PHP_SELF']}?database=" . urlencode($databases->f[$data->dbFields['dbname']]) . '&' . SID)), 'icon' => "../../../images/themes/{$conf['theme']}/database.png", 'expandedIcon' => "../../../images/themes/{$conf['theme']}/database.png", 'expanded' => false, diff --git a/libraries/lib.inc.php b/libraries/lib.inc.php index 72db96ce..5f3af024 100644 --- a/libraries/lib.inc.php +++ b/libraries/lib.inc.php @@ -3,7 +3,7 @@ /** * Function library read in upon startup * - * $Id: lib.inc.php,v 1.58 2003/09/08 04:37:16 chriskl Exp $ + * $Id: lib.inc.php,v 1.59 2003/09/10 01:55:52 chriskl Exp $ */ // Set error reporting level to max @@ -72,8 +72,10 @@ $misc = new Misc(); // Start session (if not auto-started) - session_name('PPA_ID'); - session_start(); + if (!ini_get('session.auto_start')) { + session_name('PPA_ID'); + session_start(); + } // Do basic PHP configuration checks if (ini_get('magic_quotes_gpc')) { @@ -91,7 +93,7 @@ ini_set('magic_quotes_gpc', 0); ini_set('magic_quotes_runtime', 0); ini_set('magic_quotes_sybase', 0); - ini_set('session.use_cookies', 1); + ini_set('arg_separator.output', '&'); // If login action is set, then set login variables if (isset($_POST['formServer']) && isset($_POST['formUsername']) && diff --git a/logout.php b/logout.php index 0c52ed2d..faed8dc8 100644 --- a/logout.php +++ b/logout.php @@ -3,11 +3,13 @@ /** * Logs a user out of the app * - * $Id: logout.php,v 1.2 2003/09/08 04:37:16 chriskl Exp $ + * $Id: logout.php,v 1.3 2003/09/10 01:55:52 chriskl Exp $ */ -session_name('PPA_ID'); -session_start(); +if (!ini_get('session.auto_start')) { + session_name('PPA_ID'); + session_start(); +} unset($_SESSION); session_destroy(); -- 2.39.5