About the use of ZendSession in Zend Framework 2, zendframework_PHP tutorial

WBOY
Release: 2016-07-13 10:17:47
Original
1143 people have browsed it

About the use of ZendSession in Zend Framework 2, zendframework

I have always been confused about the use of zendSession. This is the Chinese version of the official tutorial of ZendSession, http://zend-framework- 2.yangfan.co/blog/556.

The most important thing is the use of ZendSessionContainer class, which is the most important. Container is a container for storing information.

Instantiation of Container,

use ZendSessionContainer;

$container = new Container('namespace');

$container->item = 'foo';

Take out the instance of Container and instantiate the Container with the same name.

$container = new Container("namespace");

echo $container->item;

Then the value is taken out.

The problem of teaching a zend framework to use session

Zend doesn’t seem to need to be turned on. I just started watching it and there are a lot of things I don’t understand. $user = new Zend_Session_Namespace('user');
$user->name = $modelUser->username;
$user->setExpirationSeconds(3600);
This is stored directly in the session, for reference only,

How to use zend framework to implement user registration and login?

User registration or login should have a corresponding userinfo information table, which can be read from the database
As for the question you asked, I think it should be how to retain the information after login
This can be done by using session to save the login. Create a session in the future and read login information at any time

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/888531.htmlTechArticle Regarding the use of ZendSession in Zend Framework 2, zendframework has always been confused about the use of zendSession. This is the official tutorial of ZendSession. Chinese version, http://zend-framework-2.ya...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!