Session Differences In Yii

what is the difference in using session between


Yii :: app () -> getSession () -> add ('variableName', 'valorVariable');

and


Yii :: app () -> user-> setState ('variableName', 'valorVariable');

in yii

which would you use for the following scenarios and give me advice

  1. For a user logged

  2. For a user not logged in

  3. User for the first case to pass after the second case

I have used the following for adding extra user information to the user object


Yii :: app () -> user-> setState ('variableName', 'valorVariable');

Maybe this helps:

http://www.yiiframework.com/forum/index.php/topic/27232-difference-among-these-approches/page__p__131307#entry131307

Thanks, is the answer you wanted, you’re a genius