开发者

change session property in zend

开发者 https://www.devze.com 2022-12-29 00:29 出处:网络
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:

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

精彩评论

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