Home  >  Article  >  Backend Development  >  用memcache来存session,还能在另一个页面用全局变量$_SESSION来获取吗?

用memcache来存session,还能在另一个页面用全局变量$_SESSION来获取吗?

WBOY
WBOYOriginal
2016-06-06 20:08:28891browse

如果将数据写到文件中并结束当前会话。那么重新调用 session_start(),能获取数据吗?

回复内容:

如果将数据写到文件中并结束当前会话。那么重新调用 session_start(),能获取数据吗?

当然可以啦。否则还叫session吗?SESSION就是为了能跨页面保存数据的。
PHP的SESSION可以在php.ini中配置是保存在file中或是memcache或是redis中,在memcache中时,每一个session都以php开头的键名保存,生存时间根据配置中的设置,默认是1440秒。

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