views:

28

answers:

1

I made session using zend authentication it works good but my problem is I want to change some property of it from another action in other controller my code is:

$auth = Zend_Auth::getInstance();
if($auth->hasIdentity()) {
    $blogId = new model_blog request;
    $auth->getIdentity()->user_current_blog = $blogId;
    print "Current Blog";
    print_r($auth->getIdentity()->user_current_blog);
}

in this action user_current_blog change but in other action it not works!!! where I made a mistake???

A: 
$identity = $auth->getIdentity();
$identity->user_current_blog = $blogId;

$authStorage = $auth->getStorage();
$authStorage->write($identity);

http://framework.zend.com/manual/en/zend.auth.adapter.dbtable.html#zend.auth.adapter.dbtable.advanced.storing_result_row

Ballsacian1
tanks actually I add user_current_blog manually to my storage, it must be an array? Not working in all actions?
Behrang