CookieWebUser is a Yii component that using cookie only store for user auth info. It doesn't use server-side store (memcache, $_SESSION etc). This component can be used in highload projects.
Requirements ¶
Yii Framework 1.x or above.
Usage ¶
- Add CookieWebUser.php to protected/components.
- Add this code to 'user' component section in protected/config/main.php:
'components' => array(
'user' => array(
'class' => 'CookieWebUser',
'secretKey' => 'secret key',
'cookieName' => 'cookie name',
'cookieDomain' => 'cookie domain',
),
- You can use code from http://www.yiiframework.com/doc/guide/1.1/en/topics.auth to implement user authentication.
WARNING!!! Persistent states and flash messages not implemented yet.
Version ¶
0.1 - Initial release
Todo ¶
- persistent states and flash messages
Go On!
I would like to know if anyone has used this method is a real world.
It’s so good to continue this idea, Current login systems based on "Session" have heavy load on server. Specially this fact that "session based” login systems usually save sessions on database.
How we can get a list of On-line users?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.