As some of you will know. I am new to Yii and Frameworks really, but I’m having a good time with Yii. I’ve been working on a custom login which I have now got to work (I hope).
I’ve noticed that my session just keeps re-writing itself on ever page load, whether I’m trying to login or not. Obviously this defeats the object of the login and I can’t really check that the login works properly due to this. I’m at a bit of a loss as to what is causing this or where the code for it would be as it doesn’t seem confined to just logging in.
I use XAMPP locally and have no issues with logins on any other custom site.
I don’t know if this is even helpful at all, but thought it at least relevant.
I asked on the live chat and Tom mentioned that he vaguely remembered a PHP bug about this, but didn’t know how to correct it. I too have looked on the forum for help, but couldn’t seem to find anything to actually fix the problem.
I just took out autoStart and SessionName, leaving cookieMode and the path still in there and it still plays up. This is more cosmetics with the name although the save path would be nice to have somewhere outside my root. But as this is my first Yii project (for myself) I’m happy to just roll with it. Just pleased that I got it to properly log in once i removed all the session configs
noticed this thing , so i read the source code , finally find this:
// CModule::getComponent you see CHttpSession is CApplicationCompnent so is is come from this method:
public function getComponent($id,$createIfNull=true)
else if(isset($this->_componentConfig[$id]) && $createIfNull)
if(!isset($config['enabled']) || $config['enabled'])
Yii::trace("Loading \"$id\" application component",'system.CModule');
here you see the properties is set before the init method invoked
you can continue to read : Yii::createComponent($config); to see how a array can be used to initialize a instance of some class ;