Session. save_handlermemcachesession.save_pathtcp: 127.0.0.1: 11211 use commas (,) to separate multiple memcachedservers and use them as described in Memcache: addServer, it can contain additional persistent, weight, timeout, retry_interval, etc.
Session. save_handler = meMcAche
Session. save_path = "tCp: // 127.0.0.1: 11211"
Use multiple memcachEdSeparate the server with commas (,) and use Memcache:.DdServer (), which includes additional parameters such as "persistent", "weight", and ","TimeOut "," reTrY_interval "and so on, like this:" tcp: // host1: port1? Persistent = 1 & weight = 2, tcp: // host2: port2 ".
PhpSession_start (); $ _ SESSION ["UserID"] = 123; echo session _Id();?>
Use sessionid to query in memcached:
DuMp ($ memcache-> get ('19216821213cxycedec65b0883238c278eeb573e077 ');?>
When memcache is used to store sessionsFileS is much faster, and it is more convenient for multiple servers to share sessions. You can configure these servers to use the same group of memcached servers, reducing the additional workload. The disadvantage is that session data is stored in memory, which lacks persistence, but it is not a big problem for session data.