Home  >  Article  >  Backend Development  >  session没法传递,files保存可以,mysql保存却无法传递

session没法传递,files保存可以,mysql保存却无法传递

WBOY
WBOYOriginal
2016-06-13 12:06:29818browse

session无法传递,files保存可以,mysql保存却无法传递
将验证码保存在session,当用files来保存session的时候,用户注册的时候能在后台$_SESSION['captcha']读取到这个验证码,也就是说能正常传递,但是改为用mysql来保存session的时候,能正常储存session(在数据库里能看到有captcha的session值),在生成验证码的那个页面用$_SESSION['captcha']也是能读到那个值的,但是之后用户注册后台另一个页面却读取不到这个值,(也就是说不能传递了),很久之前都是可以的,现在发现居然不行了,有没有谁能想到是什么原因?
------解决思路----------------------

该回复于2014-09-18 15:04:13被管理员删除
------解决思路----------------------
为防止意外情况出现
程序应无条件加载 SessionHandler.php
而实例化对象和 session_start() 都应在 SessionHandler.php 中进行
你还使用了命名空间,这就更需要注意排查新的故障点
Statement:
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