downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Memcached> <Read-through キャッシュコールバック
[edit] Last updated: Fri, 17 May 2013

view this page in

セッションのサポート

Memcached は独自のセッションハンドラを用意しており、 これを使用するとユーザーセッションを memcache に格納することができます。 内部的に使用するのは完全に分離された memcached インスタンスなので、 必要に応じて別のサーバープールを使用することができます。 セッションのキーは、プレフィックス memc.sess.key. をつけて格納されます。 同じサーバープールでセッションと一般のキャッシュを両方使用する場合は注意しましょう。

session.save_handler string

memcached を設定すると、セッションのサポートが有効となります。

session.save_path string

ホスト名:ポート 形式のエントリをカンマ区切りで指定します。 これをセッションサーバープールとして使用します。たとえば "sess1:11211, sess2:11211" のようになります。



Memcached> <Read-through キャッシュコールバック
[edit] Last updated: Fri, 17 May 2013
 
add a note add a note User Contributed Notes セッションのサポート - [4 notes]
up
1
nfoo at naver dot com
2 years ago
If you want to use 'memcacheD' extention not 'memcache' (there are two diffrent extentions) for session control,  you should pay attention to modify php.ini

Most web resource from google is based on memcache because It's earlier version than memcacheD. They will say as following

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

But it's not valid when it comes to memcacheD

you should modify php.ini like that

session.save_handler = memcached
session.save_path = "localhost:11211"

Look, there is no protocol indentifier
up
1
Andrei Darashenka
3 years ago
This extension supports Session-locking!

by default
MEMC_SESS_LOCK_ATTEMPTS   30
MEMC_SESS_LOCK_WAIT       100000
MEMC_SESS_LOCK_EXPIRATION 30
up
0
taubers at gmail dot com
7 months ago
If you are using the memcache class for session handling your key is the PHP session ID.  This is different than when using the  memcached class.

Example with memcache:
GET nphu2u8eo5niltfgdbc33ajb62

Example with memcached:
GET memc.sess.key.nphu2u8eo5niltfgdbc33ajb62

For memcached, the prefix is set in the config:
memcached.sess_prefix = "memc.sess.key."
up
0
sstratton at php dot net
1 year ago
While the previous poster has a point that Memcached can and will cleanup to make room for it's keys, the likelihood of active sessions (due to the likelihood that they will be written to again within 30 seconds) is fairly low provided you have your memory allocation properly alloted.

 
show source | credits | sitemap | contact | advertising | mirror sites