All attributes that should be saved with saveAsDefaults() must be listed in the attributes property of the behavior.

The complete list of configuration options is:

attributes - list of attribute names that can be saved / loaded

safeOnly - if true, only attributes that are safe in the current scenario will be loaded with loadDefaults(). Default is false.

stateKeyPrefix - prefix for the user state key that is used to store defaults. Actual key name will be prefix + model class name. Defaults to 'default_'.

If loadDefaults() is called before any values where ever saved with saveAsDefaults() the model is scanned for a method attributeDefaults(). If this method is found the returned values (name/value pairs) will be set as default. If no such method is available, loadDefaults() will do nothing in this case.

Since Version 1.1.0 resetDefaults() can be used to clear all, one or a list of attributes default values.

If YII_DEBUG is true, this behavior will trace some messages under the category application.behavior.defaultpersister.

One scenario where this behavior can come in handy is e.g. when a model is used as complex filter model for a datagrid. Think of a backend area with pages for users and projects, each showing a filter form and a datagrid. Changes in the filter form trigger a AJAX grid update. Whenever backend personnel accesses such a page the last filter settings should be restored for convenience.

Yeah, i got ur point.
But the reason i thought this is for the flexibility of switching the storage mechanism for this behavior irrespective to what session component is defined in the application component.

Like, for some model will use this to store in $_SESSION and some other model to store in DB.

If it always use the session application component it won't be possible? OR is it?

Plz let me know if i am mistaken. i am planning to use it, so just clarifying.

can also add an option to store the values to the Db using the CDbHttpSession.
This will be more persistant and comes handy by storing users 'last entered data' in the forms and when the user login we can show that last entered data as the default values for that form fields.

setState stores information in cookies file, so if you overindulge saving defaults into cookies, it might cause problems (google maximum cookies size for different browsers - this article is exists on wiki). Why don't take users defaults from database, put into memcache, so they are available all the time during the session and once session is destroyed, delete memcache key (if did not expired yet) ?
My opinion, - this is convenient, but technically wrong. Cookies is not the place to store defaults.