I've searched half a day for how to resolve this issue, and can't figure it out. Shortly after I made my wiki a simple private wiki according to the instructions at Mediawiki's website, it started giving me this weird login error message: Wiki uses cookies to log in users. You have cookies disabled. Please enable them and try again.
If I remove those private wiki settings, the error disappears, even if I try logging in. But I need it to be a private wiki for only my team. So what do I do?
Here's what I've done so far. Just to be safe, after ever change, I try rebooting Apache using:
- sudo /etc/init.d/apache2 restart
In my php.ini file, I have the following set:
- session.save_path = "/var/lib/php5"
- session.cookie_secure = secure
- session.cookie_path = /tmp session.cookie_domain = my server's internal URL (should I even set this? this field was blank before, but not commented out)
- session.referer_check = Off
I ran the following to ensure that the folders are writable:
- sudo chmod -R 1777 /var/lib/php5
- sudo chmod -R 1777 /tmp
In my LocalSettings.php file, I have the following added to the bottom of the settings file:
- session_save_path("tmp");
- $wgSessionsInObjectCache = true;
- $wgMainCacheType = CACHE_ANYTHING;
- $wgDebugToolbar = true;
- $wgDebugLogFile='/var/log/mediawiki/mediawiki.log';
- $wgShowExceptionDetails = true;
- $wgShowDebug = true;
- $wgDevelopmentWarnings = true;
For the above tmp, I created the folder /etc/mediawiki/tmp and also ran the following:
- sudo chmod -R 1777 /etc/mediawiki/tmp
I know that the cookie is coming through to the browser because I can see the cookie in Firebug and verify that the same cookie got created in the /tmp folder.
SSL seems to be configured properly, because I get the green lock.
This is my debug output after trying to log in:
Debug data:
Start request
POST /mediawiki/index.php?title=Special:UserLogin&action=submitlogin&type=login&returnto=Special:RecentChanges
- HTTP HEADERS:
- HOST: bs-wiki.sis.org.cn
- CONNECTION: keep-alive
- CONTENT-LENGTH: 122
- CACHE-CONTROL: max-age=0
- ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
- ORIGIN: https://bs-wiki.sis.org.cn
- UPGRADE-INSECURE-REQUESTS: 1
- USER-AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36
- CONTENT-TYPE: application/x-www-form-urlencoded
- DNT: 1
- REFERER: https://bs-wiki.sis.org.cn/mediawiki/index.php?title=Special:UserLogin&returnto=Special%3ARecentChanges&returntoquery=
- ACCEPT-ENCODING: gzip, deflate
- ACCEPT-LANGUAGE: en-US,en;q=0.8
COOKIE: __gads=ID=f46767e352615a06:T=1453974579:S=ALNI_MaImAtsIj8Xb-3kERZtmSWx82DxNA; bs_wikiUserName=Rpark1; bs_wikiLoggedOut=20160128105049; bs_wiki_session=3fck92pn1uq1l1s852oq6rfdl3
CACHES: SqlBagOStuff[main] SqlBagOStuff[message] SqlBagOStuff[parser]
- Connecting to localhost bs_wiki...
- Profiler::instance called without $wgProfiler['class'] set, falling back to ProfilerStub for safety
- Connected to localhost bs_wiki.
- Connecting to localhost bs_wiki...
- Connected to localhost bs_wiki.
- DatabaseBase::query: Writes done: DELETE FROM
objectcache
WHERE keyname = 'bs_wiki:stats:request_with_session'- LocalisationCache: using store LCStore_DB
- Unstubbing $wgParser on call of $wgParser::setFunctionHook from unknown
- Parser: using preprocessor: Preprocessor_DOM
- Fully initialised
- Unstubbing $wgAuth on call of $wgAuth::validDomain from unknown
- IP: 172.18.12.59
- MessageCache::load: Loading en... got from global cache
- Unstubbing $wgLang on call of $wgLang::_unstub from unknown
- MWCryptRand::realGenerate: Generating cryptographic random bytes for LoginForm::setLoginToken/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate
- MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 16 bytes of strong randomness.
- MWCryptRand::realGenerate: 0 bytes of randomness leftover in the buffer.
- Class SkinVector not found; skipped loading
- Class PEAR_Error not found; skipped loading