PHP Session 对象的问题 [英] Problem with PHP Session Object
问题描述
我的 php 会话遇到了一些问题.我在我的moodle应用程序中部署了一个文件管理插件.
I am facing some problem with my php session. I have deployed a plugin for file management in my moodle application.
新插件主页出现意外行为,正在破坏我的应用程序的实际会话并生成新的 session_id()
.
The new plugin home page is behaving unexpectedly and is destroying the actual session of my application and is generating new session_id()
.
此外,当我尝试使用 print_r($_SESSION)
查看会话内容时,它显示PHP_Incomplete_Class_Name"在里面.
Also when I am trying to view session contents using print_r($_SESSION)
, it is showing
"PHP_Incomplete_Class_Name" in it.
推荐答案
实际上 PHP_Incomplete_Class_Name
与会话重新生成无关.
Actually PHP_Incomplete_Class_Name
has nothing to do with session regeneration.
当您(或您的 cms/框架/任何您拥有的)在解析每个序列化对象的类定义之前调用 session_start()
时,就会出现这种行为.
This behaviour appears when you (or your cms/framework/whatever you have) call session_start()
before each serialized object's class definition has been parsed.
因此您需要在开始会话之前包含所有课程.
So you need to include all classes before you started session.
这篇关于PHP Session 对象的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!