简体   繁体   中英

Different session for admin and front end

Its my 1st App using ZF. As our client requirement i have made separate admin and front panel. Without using Zend_Acl. I have problem when session expires it always takes me on front end log in page . I have tried to solve it by session but it's using single session for both admin anf front panel. I there any way so i can create separate session for both admin and front panel ?

abstract class My_Controller_Action extends Zend_Controller_Action
{     
    public function init()
    {
        parent::init();

        $this->auth = Zend_Auth::getInstance();
        if ($this->getRequest()->getModuleName() == 'admin') {
            $this->auth->setStorage(new Zend_Auth_Storage_Session('Zend_Auth_Admin'));
            $this->session = new Zend_Session_Namespace('AdminSession');
        } else {
            $this->session = new Zend_Session_Namespace('FrontSession');
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM