MediaWiki sessions and cookies not working on multi-server behind CloudFlare

一个人想着一个人 提交于 2019-12-02 12:00:24

问题


I have a MediaWiki running on multiple AWS instances and login and registration is broken. The session.save_path is set to /tmp which is writeable and readable by anyone. I use Apache2 and PHP5 as well as MEMCACHED.

Whenever you try to login you either get informed that there is protection against session hijacking or that you have cookies off. These are the errors:

There seems to be a problem with your login session; this action has been canceled as a precaution against session hijacking. Go back to the previous page, reload that page and then try again.


Wiki uses cookies to log in users. You have cookies disabled. Please enable them and try again.

I use a shared cookiedomain in the format ".domain.tld" and the entire domain is behind CloudFlare and an Amazon ELB load balancer. All LocalSettings.php are the same and the Apaches have shared configurations.


回答1:


Per Aaron Schulz, don't use the default session handling, it's disastrous.

As you have memcached enabled, add

$wgMainCacheType = CACHE_ANYTHING;
$wgSessionsInObjectCache = true;

in your LocalSettings.php and let us know if things improved (they definitely should).



来源:https://stackoverflow.com/questions/25317403/mediawiki-sessions-and-cookies-not-working-on-multi-server-behind-cloudflare

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!