php 写session

function do_login(){
		//获取用户名和密码信息,和数据库中比对
		 echo 111111111;
		dump($_POST);
		dump($_SESSION);
		echo 222222222;
		$username=$_POST['username'];
		$password=$_POST['password'];
		$code=$_POST['code'];
		if($_SESSION['verify']!==md5($code)){
			$this->error('验证码错误');
		}


111111111

array (size=3)
  'username' => string 'admin' (length=5)
  'password' => string 'admin' (length=5)
  'code' => string '7038' (length=4)

array (size=3)
  'verify' => string 'b19d3c9e40467f65287c078ea8970b83' (length=32)
  'username' => string 'admin' (length=5)
  'authority' => string '1' (length=1)

222222222

posted @ 2016-06-28 21:57  czcb  阅读(132)  评论(0编辑  收藏  举报