Sessions In Files Are Not Save With Chttpsession Extension

Hi!

If I extend CHttpSession and overwrite the methods openSession, closeSession, readSession, writeSession, destroySession and gcSession and set useCustomStorage to true. The files sessions are not created in path and user are not login in app!

Class code




class CHttpSessionExt extends CHttpSession{

		

	public function getUseCustomStorage(){

		return true;

	}

	/*

	 *  openSession, closeSession, readSession, writeSession, destroySession and gcSession 

	 * */

	

	public function openSession($savePath, $sessionName){

		Yii::trace( '[CHttpSessionExt][openSession] start '.$savePath.' -> '.$sessionName );	

		return true;		

	}

	

	public function closeSession(){

		Yii::trace( '[CHttpSessionExt][closeSession] start' );		

		return true;

	}

	public function readSession($id){

		Yii::trace( '[CHttpSessionExt][readSession] start '.$id );		

		return true;

	}

	public function writeSession($id, $data){

		Yii::trace( '[CHttpSessionExt][writeSession] start '.$id.' -> '.$data );		

		return true;

	}

	public function destroySession($id){

		Yii::trace( '[CHttpSessionExt][destroySession] start destruction: '.$id );		

		return true;

	}

	

	public function gcSession($maxLifetime){

		Yii::trace( '[CHttpSessionExt][gcSession] start $maxLifetime:'.$maxLifetime );		

		return true;

	}

	

}

Config file




'session'=>array(

	'class' => 'application.components.CHttpSessionExt',

	'autoStart' => true,		

	'savePath' =>  dirname(__FILE__).DIRECTORY_SEPARATOR.'../runtime/sessions'

),



If I comment ‘class’ key, default session component create session file in my custom path or default path if comment ‘savePath’ key. How is this possible? What is wrong with my session component?

Ok, finally I understand my error.

If I use custom staroge I must define all process for to save in file, to read file, etc. This functions not define a custom action for to do when open session or delete session (after execute open session, delete session) but are the open session funtion, delete session funtion, etc.

Then, if i want add a action after create or expired session I must define in each funtion all process of save file in path, read file, etc and add my custom functionality.

Can you please post the working code ? I want to use custom session file name for my sessions but don’t know how ? :( I appreciate your help!