Enable Yii session handling at the database


For security reasons, you can the session with Yii does not have the file system, but the database manage can automatically encrypt the session variable.

Following configuration is required:

'components' => array(      
     'session'=>array(
            'class' => 'system.web.CDbHttpSession',
            'connectionID' => 'db',
            'sessionTableName' => 'session',
            'autoStart'=>true,
            'cookieMode'=>'only',
            //'savePath'=>'/tmp',
            'sessionName'=>'connected_session',
            'timeout'=>60*60,// 1 hour
            'useTransparentSessionId'=>false,
        ),