From f2a2f58c7ae50dd3afb7a6b9b3854170daee4180 Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 15 Nov 2011 00:47:09 +0000 Subject: [PATCH] Stopped PHP sessions from blocking HTTP requests. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11001 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/lib/functions.php | 2 +- xCAT-UI/lib/log.php | 2 ++ xCAT-UI/lib/srv_functions.php | 2 +- xCAT-UI/lib/srv_log.php | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-UI/lib/functions.php b/xCAT-UI/lib/functions.php index 3fa8eded5..14ebc052c 100644 --- a/xCAT-UI/lib/functions.php +++ b/xCAT-UI/lib/functions.php @@ -5,6 +5,7 @@ // Retain session variables across page requests session_start(); +session_write_close(); // Do not block HTTP requests // The settings below display error on the screen, // instead of giving blank pages. @@ -307,7 +308,6 @@ function logout() { // Clear server store of data $_SESSION=array(); - session_destroy(); } /** diff --git a/xCAT-UI/lib/log.php b/xCAT-UI/lib/log.php index bd235d141..6e20b34d8 100644 --- a/xCAT-UI/lib/log.php +++ b/xCAT-UI/lib/log.php @@ -3,6 +3,8 @@ $TOPDIR = '..'; require_once "$TOPDIR/lib/functions.php"; require_once "$TOPDIR/lib/jsonwrapper.php"; +session_start(); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); diff --git a/xCAT-UI/lib/srv_functions.php b/xCAT-UI/lib/srv_functions.php index 3f427cab3..624db7687 100644 --- a/xCAT-UI/lib/srv_functions.php +++ b/xCAT-UI/lib/srv_functions.php @@ -5,6 +5,7 @@ // Retain session variables across page requests session_start(); +session_write_close(); // Do not block HTTP requests // The settings below display error on the screen, // instead of giving blank pages. @@ -319,6 +320,5 @@ function logout() { // Clear server store of data $_SESSION=array(); - session_destroy(); } ?> diff --git a/xCAT-UI/lib/srv_log.php b/xCAT-UI/lib/srv_log.php index 33a376cdc..5a9f3bccc 100644 --- a/xCAT-UI/lib/srv_log.php +++ b/xCAT-UI/lib/srv_log.php @@ -3,6 +3,8 @@ $TOPDIR = '..'; require_once "$TOPDIR/lib/srv_functions.php"; require_once "$TOPDIR/lib/jsonwrapper.php"; +session_start(); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false);