X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=HTML%2FFlexyFramework%2FPage.php;h=e8add0e59829c88ed16793bcdde78059f5c08706;hb=HEAD;hp=4a5c810eae4947c0cb1201f2dcf043a488da5547;hpb=790f901d5513b447548122ba02f1e117aa204b21;p=pear diff --git a/HTML/FlexyFramework/Page.php b/HTML/FlexyFramework/Page.php index 4a5c810e..e8add0e5 100644 --- a/HTML/FlexyFramework/Page.php +++ b/HTML/FlexyFramework/Page.php @@ -154,6 +154,8 @@ class HTML_FlexyFramework_Page { + var $timer; + /** * The default page handler * by default relays to get(), or post() methods depending on the request. @@ -296,7 +298,7 @@ class HTML_FlexyFramework_Page { } $template_engine->elements = $this->elements; $template_engine->outputObject($this,$this->elements); - + return ''; } @@ -403,6 +405,12 @@ class HTML_FlexyFramework_Page { { static $ses_status = false; static $ini = false; + + if (!empty($_SERVER['PHP_AUTH_USER']) || php_sapi_name() == "cli") { + // do not do sessions if we are using http auth. + return; + } + // session status is only php5.4 and up.. if (!defined('PHP_SESSION_ACTIVE')) { define('PHP_SESSION_ACTIVE' , 1); @@ -430,8 +438,31 @@ class HTML_FlexyFramework_Page { $ini = true; // sometimes raises a notice - ps_files_cleanup_dir. @session_start(); + $this->dedupeSessionCookies(); return; } } + + function dedupeSessionCookies() + { + if (headers_sent()) { + return; + } + $cookies = array(); + + foreach (headers_list() as $header) { + // Identify cookie headers + if (strpos($header, 'Set-Cookie:') === 0) { + $cookies[] = $header; + } + } + header_remove('Set-Cookie'); + + // Restore one copy of each cookie + foreach(array_unique($cookies) as $cookie) { + header($cookie, false); + } + } + }