PHP 函数 session_module_name 到底是做什么用的? [英] What exactly is the PHP function session_module_name for?
问题描述
PHP Session相关函数有这个:session_module_name一>.文档只说:
PHP Session related functions have this one: session_module_name. The documentation only says:
session_module_name — 获取和/或设置当前会话模块
session_module_name — Get and/or set the current session module
没有关于什么是会话模块、可用选项以及何时使用.
Nothing about what session modules are, what options available, and when it to use.
这个函数的目的是什么?
What is the purpose of this function?
推荐答案
session_module_name 定义了会话的存储方式.您可以将它与 session_set_save_handler 结合使用来手动处理会话,例如,如果您想从数据库保存/加载会话.快速搜索显示至少有 3 个模块
The session_module_name defines how sessions are stored. You can use this in conjunction with session_set_save_handler to handle sessions manually, such as if you wanted to save/load sessions from a database. A quick search shows that there are at least 3 modules
<?php
session_module_name("files"); // ASCII files
session_module_name("mm"); // Shared memory
session_module_name("user"); // Custom session backend
?>
也许还有更多.如果 session_module_name 文档条目更有帮助,那就太好了.
Perhaps there are more. It would be nice if the session_module_name docs entry was a bit more helpful.
这篇关于PHP 函数 session_module_name 到底是做什么用的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!