Skip to content

Instantly share code, notes, and snippets.

@zluiten
Last active December 11, 2015 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zluiten/4547622 to your computer and use it in GitHub Desktop.
Save zluiten/4547622 to your computer and use it in GitHub Desktop.
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Session\SessionManager;
use Zend\Session\Storage\SessionArrayStorage;
use Zend\Session\Storage\SessionStorage;
use Zend\Authentication\Storage\Session as AuthSession;
class IndexController extends AbstractActionController
{
public function indexAction()
{
//$manager = new SessionManager();
//$manager->setStorage(new SessionStorage());
//$storage = new AuthSession(get_class($this), null, $manager);
$storage = new AuthSession(get_class($this));
$storage->write(array('message' => 'is this message stored?'));
return new ViewModel();
}
public function testAction()
{
//$manager = new SessionManager();
//$manager->setStorage(new SessionStorage());
//$manager->setStorage(new SessionStorage());
//$storage = new AuthSession(get_class($this), null, $manager);
$storage = new AuthSession(get_class($this));
$message = $storage->read(); //null
return array('message' => $message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment