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?