我想知道是否可以在会话到期时将会话数据保存到数据库或文件中。例如,当我的会话中有一个对象时,会话到期时会调用析构函数吗?
基本上,问题是PHP如何在会话过期时处理会话。
谢谢你的帮助!
我想知道是否可以在会话到期时将会话数据保存到数据库或文件中。例如,当我的会话中有一个对象时,会话到期时会调用析构函数吗?
基本上,问题是PHP如何在会话过期时处理会话。
谢谢你的帮助!
看起来您可以使用session_set_save_handler
函数定义一个回调,该回调在会话被破坏时被调用。
顺便说一句,我想问一下,在会话超时时保存数据,而不仅仅是在会话期间保存数据,这是否是一个好的设计。
要更改会话的最长生存期,请尝试以下操作:
ini_set("session.gc_maxlifetime", "18000");
这将使寿命设置为5小时。您必须在每个要更改其默认生存期的脚本中使用此选项。
要获取会话的生存期:
echo ini_get("session.gc_maxlifetime");
What are the advantages/disadvantages of using include/require s to achieve a singular file that contains multiple pages as opposed to directing the user to many individual pages and storing the ...
I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...
What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...
I am storing an array of a custom serializable class in session on my site. When a page on the site changes, suddenly it renders them invalid, and tells me that it can t cast the type to it s own ...
I ve tried searching for this but it s pretty difficult to put into words. Basically, our site will run fine for most users without any issues. Sometimes though, those of us who use the site pretty ...
Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...
提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......
I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...