手册:$wgCookiePrefix
Appearance
Cookies: $wgCookiePrefix | |
---|---|
Custom cookie prefix. |
|
引进版本: | 1.13.0 (r37893) |
移除版本: | 仍在使用 |
允许的值: | (字符串)或false |
默认值: | false |
其他设置: 按首字母排序 | 按功能排序 |
细节
Prefix for cookies and similar browser data (including localStorage).
Set it to use a custom one.
Setting it to false
sets the default of using the database name.
Code should ensure browser saved data is prefixed with this value (this is currently done automatically only when WebResponse->setcookie
is used without a custom prefix).
The default value is determined in Setup.php :
if ( $wgCookiePrefix === false ) {
if ( $wgSharedDB && $wgSharedPrefix && in_array( 'user', $wgSharedTables ) ) {
$wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
} elseif ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
$wgCookiePrefix = $wgSharedDB;
} elseif ( $wgDBprefix ) {
$wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
} else {
$wgCookiePrefix = $wgDBname;
}
}