Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use ZendSessionContainer;
- $session = new Container('base');
- $session->offsetExists('email')
- $email = $session->offsetGet('email');
- $session->offsetSet('email', $email);
- $session->offsetUnset('email');
- $session = new Container('foo');
- $session['bar'] = 'foobar';
- $session->bar = 'foobar';
- $session->offsetSet('bar', 'foobar');
- use ZendSessionContainer as SessionContainer;
- $this->session = new SessionContainer('post_supply');
- $this->session->ex = true;
- var_dump($this->session->ex);
- <?php
- $registry = Zend_Registry::getInstance();
- $DB = $registry['DB'];
- $authAdapter = new Zend_Auth_Adapter_DbTable($DB);
- $authAdapter->setTableName('user');
- $authAdapter->setIdentityColumn("user_name");
- $authAdapter->setCredentialColumn("user_password");
- //get values
- $username = $request->getParam('username');
- $password = $request->getParam('password');
- //set values
- $authAdapter->setIdentity($username);
- $authAdapter->setCredential($password);
- $auth = Zend_Auth::getInstance();
- //to store in session
- $auth->setStorage(new Zend_Auth_Storage_Session('front'));
- $authResult = $auth->authenticate($authAdapter);
- if ($authResult->isValid()) {
- $authAdap = $authAdapter->getResultRowObject(null, "Password");
- $auth->getStorage()->write($authAdap);
- $this->_redirect('/login/controlpannel');
- } else {
- $this->_redirect('/login/login');
- }
- ?>
- <?php
- $auth = Zend_Auth::getInstance();
- $auth->setStorage(new Zend_Auth_Storage_Session('front'));
- if($auth->hasIdentity()){
- $data = $auth->getStorage()->read();
- print_r($data);
- }else{
- $this->_redirect('/login/login');
- }
- ?>
- zendsessioncontainer
Add Comment
Please, Sign In to add comment