在Apache中使用 memcached 来作 session 存储

Linux大全评论757 views阅读模式

session.save_handler = memcache
session.save_path = "tcp://127.0.0.1:11211"

使用多个 memcached server 时用逗号","隔开,并且和 Memcache::addServer() 文档中说明的一样,可以带额外的参数"persistent"、"weight"、"timeout"、"retry_interval" 等等,类似这样的:"tcp://host1:port1?persistent=1&weight=2,tcp://host2:port2" 。

<?phpsession_start();$_SESSION["UserID"]=123;echo session_id();?>
用 sessionid 去 memcached 里查询一下:

企鹅博客
  • 本文由 发表于 2019年9月21日 18:30:49
  • 转载请务必保留本文链接:https://www.qieseo.com/142471.html

发表评论