Yii 1.1: cookiewebuser

Yii cookie-based WebUser component

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.


Yii Framework 1.x or above.


  • 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',

WARNING!!! Persistent states and flash messages not implemented yet.


0.1 - Initial release


  • persistent states and flash messages


Total 1 comment

#7950 report it
amiri at 2012/04/27 11:05pm
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?

Leave a comment

Please to leave your comment.

Create extension