Jump to content

Manual:$wgSessionCacheType

From mediawiki.org
This page is a translated version of the page Manual:$wgSessionCacheType and the translation is 44% complete.
Memcached の設定: $wgSessionCacheType
セッション データを格納するキャッシュの種類。
導入されたバージョン:1.20.0 (Gerrit change 17929; git #6eb6313b)
除去されたバージョン:使用中
許容される値:CACHE 定数のいずれか ($wgMainCacheType 参照)
既定値:CACHE_ANYTHING

詳細

セッション データの格納メカニズムです。 Note that despite the name saying "cache" this is the primary storage mechanism for sessions; if it doesn't work, it will be impossible to log in to the wiki.

利用できる種類については $wgMainCacheType を参照してください。

For proper operation this must be set to a persistent cache, and if there are multiple servers that might serve a single client's requests the cache must be shared by all of them.

If $wgMainCacheType is set to CACHE_ACCEL and this is left at its default CACHE_ANYTHING, the cache used may not meet these requirements.

The solution is to set this to an appropriate cache, such as CACHE_DB.

Note that if CACHE_DB is used then users cannot log in when the respective wiki's database was locked with e.g. $wgReadOnly .

Session share hack

Before MediaWiki 1.27, some wiki farms used a single domain, shared user tables and a shared session cache directory as a poor man's single sign-on. Since 1.27 file-based session cache cannot be used; to achieve the same thing, use something like:

$wgSessionCacheType = 'session-cache';
$wgObjectCaches['session-cache'] = [
    'factory' => 'ObjectCache::newAnything',
    'keyspace' => 'shared-session'
];

which will make the session cache of all wikis use the same keyspace.

Note that this method is not officially supported and can lead to things breaking if you use an extension that tries to put different things in the session on different wikis; use at your own risk. Also, it only works in 1.30 or later.

関連項目