CHttpSession
is a nifty OO wrapper for php sessions. The underlying implementation uses php's session methods. Here's a snippet of part of the code for CHttpSession::open()
:
public function open()
{
if($this->getUseCustomStorage())
@session_set_save_handler( array($this,'openSession'),array($this,'closeSession'),array($this,'readSession'),array($this,'writeSession'),array($this,'destroySession'),array($this,'gcSession'));
@session_start();
For Yii convention, always use CHttpSession
instead of $_SESSION
.