Permalink
Browse files

support sessions for browser with no cookies

  • Loading branch information...
1 parent c649ac0 commit cc8255139537dacf3ab0daa7d61867ab5774e07a chriskl committed Sep 10, 2003
Showing with 20 additions and 13 deletions.
  1. +9 −6 browser.php
  2. +6 −4 libraries/lib.inc.php
  3. +5 −3 logout.php
View
@@ -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 @@ function addNodes(&$schemanode, $querystr) {
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 @@ function addNodes(&$schemanode, $querystr) {
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 @@ function addNodes(&$schemanode, $querystr) {
// 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 @@ function addNodes(&$schemanode, $querystr) {
} 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,
View
@@ -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']) &&
View
@@ -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();

0 comments on commit cc82551

Please sign in to comment.