Heim  >  Artikel  >  Backend-Entwicklung  >  zf框架的session会话周期及次数限制使用示例_PHP教程

zf框架的session会话周期及次数限制使用示例_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:36:001089Durchsuche

复制代码 代码如下:

require_once("Zend/Loader.php");
Zend_Loader::loadClass("Zend_Session_Namespace");
$Session = new Zend_Session_Namespace('Db');
$Session ->host     = '127.0.0.1';
$Session ->username = 'root';
$Session ->password = '111';
$Session ->dbname   = 'test';
//定义会话过期时间
$Session ->setExpirationSeconds(300);
//定义会话步骤次数
$Session ->setExpirationHops(2 , 'host');
$Session ->setExpirationHops(3 , 'username');
$Session ->setExpirationHops(4 , 'password');
$Session ->setExpirationHops(5 , 'dbname');
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/741263.htmlTechArticle复制代码 代码如下: ?php require_once("Zend/Loader.php"); Zend_Loader::loadClass("Zend_Session_Namespace"); $Session = new Zend_Session_Namespace('Db'); $Session -host = '12...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn