views:

97

answers:

1

Hi,

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 ?

A: 
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');
        }
    }
}
Justin