How can I fix the MediaWiki error “Wiki uses cookies to log in users. You have cookies disabled. Please enable them and try again.”?

前端 未结 12 2280
春和景丽
春和景丽 2021-02-14 02:03

The problem I am having is that I can not log on to my newly created wiki that I made using MediaWiki. I have searched the web for an answer, and the ones I found did not help w

相关标签:
12条回答
  • 2021-02-14 02:22

    same thing may happen when memcached is used to store session files. in this case wiki will be unable to write cookies neither in / neither in /tmp. if you see in error.log something like "file not found (11211:9001/qweqweqweqweqe)" this will mean, that you have memchached installed and configured and you need to append the following lines in LocalSettings.php:

    $wgMainCacheType = CACHE_MEMCACHED; 
    $wgParserCacheType = CACHE_MEMCACHED; # optional 
    $wgMessageCacheType = CACHE_MEMCACHED; # optional 
    $wgMemCachedServers = array( "127.0.0.1:11211" );
    $wgSessionsInMemcached = true; # optional
    
    0 讨论(0)
  • 2021-02-14 02:25

    Another thing to check is if your session tmp directory is full. Symptoms are "write failed" messages in your http server error log. Duh!

    0 讨论(0)
  • If you are using NGINX + PHP-FPM the previous answers will likely not solve your problem.

    From my experience, this issue is caused when php-fpm doesn't have write access to the cookie_path. You can find this path by running:

    php-fpm -i|grep --color cookie_path
    

    See what your cookie_path is, then stat the folder and ensure your php-fpm user has write access to it.

    To resolve this issue using Nginx and Php-Fpm, I had to change my cookie_path from it's default of / (seriously, why would this be a default?) to /tmp.

    After restarting nginx and php-fpm, it works perfectly.

    0 讨论(0)
  • 2021-02-14 02:27

    I also had this issue ...

    All my browsers were complaining about cookies being turned off....

    I thouhgt a group policy had been implemented to disable cookies. After conferring with my server support team that nothing as such had been implemented I decided to remote to the server.

    The server was complaining about low disk space. I cleaned up the disk by deleting some old unrelated files.

    Tried to logon again from my browser and all was Ok.

    0 讨论(0)
  • 2021-02-14 02:27

    Put

    $wgDisableCookieCheck = true;
    

    in your LocalSettings.php.

    (source)

    0 讨论(0)
  • 2021-02-14 02:30

    One answer which hasn't been mentioned here - make sure your file system isn't out of space.

    0 讨论(0)
提交回复
热议问题