开发者

change session property in zend

I made session using zend authe开发者_高级运维ntication 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???


$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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜