From 94e94e0a8566f23d16658a04c55b0bbfdd6689aa Mon Sep 17 00:00:00 2001 From: "godzilla80@gmx.net" <> Date: Sun, 14 Feb 2010 01:22:57 +0000 Subject: Merge Branches & Trunk /trunk:r2680,2692,2707-2736 /branches/3.1:r2682-2686,2694-2702,2705,2738-2762 --- framework/Web/THttpSession.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'framework/Web/THttpSession.php') diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php index 96d70704..e9f815e5 100644 --- a/framework/Web/THttpSession.php +++ b/framework/Web/THttpSession.php @@ -4,7 +4,7 @@ * * @author Qiang Xue * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web @@ -115,7 +115,7 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar if($this->_autoStart) $this->open(); $this->_initialized=true; - $this->getApplication()->setSession($this); + $this->getApplication()->setSession($this); register_shutdown_function(array($this, "close")); } @@ -296,6 +296,7 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar { ini_set('session.use_cookies','1'); ini_set('session.use_only_cookies','1'); + ini_set('session.use_trans_sid', 0); } } } @@ -366,7 +367,12 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar if($this->_started) throw new TInvalidOperationException('httpsession_transid_unchangeable'); else - ini_set('session.use_trans_sid',TPropertyValue::ensureBoolean($value)?'1':'0'); + { + $value=TPropertyValue::ensureBoolean($value); + if ($value && $this->getCookieMode()==THttpSessionCookieMode::Only) + throw new TInvalidOperationException('httpsession_transid_cookieonly'); + ini_set('session.use_trans_sid',$value?'1':'0'); + } } /** -- cgit v1.2.3