Common login?

I am integrating a Yii app with another which is not Yii. It is from the same domain so it seems that a common cookie would be great. Is there a way to get/set the Yii cookie name?

Thank you,


This subject offered by you is very constructive for correct planning.

I’m still learning from this blog, but I’m trying to reach my goals. I absolutely love reading everything that is written on your website.Keep the posts coming. I loved it!

Thank you for your good post,I really liked reading it

I don’t think yii stores a cookie expect the “Remember me” case on the login page.

You can set a common cookie with the name you want in your application yourself. There is a nice wiki article cookie management which should help you.


may be these will be useful:





I integrated Yii with a forum running on same domain. Right now my little "hack" is working quite well. The user keeps logged in when he uses forum and then switches to my little Yii site.

I’ll explain you how i did it:

Yii keeps its user session values similar like this:

[307a8147f05864a4802935667deb4f88__id] => xxx

[307a8147f05864a4802935667deb4f88__name] => xxx

So it won’t disturb my forum application session.

All the magic is done, when i use same session name for both applications. When coming from another forum(or site) to my Yii application, I can check fromthe session if the user has logged in to forum or not. If he has logged in to forum and not logged in to Yii then i’ll just copy user name and id from the forum session to Yii’s session. Logout is made with session_destroy.

Hope it helps!