$user_session = new \Zend\Session\Container('user');
$user_session->username = 'Andy0708'; // Write to session
echo $username = $user_session->username; // Read from session
$user_session = new \Zend\Session\Container('user');
$user_session->username = 'Andy0708'; // Write to session
echo $username = $user_session->username; // Read from session
转载于:https://www.cnblogs.com/xuyaoxiang/archive/2013/04/26/3044795.html