我刚刚在AS400 IBM i机器上设置了MediaWiki 1.29.0页面。我使用MariaDB作为数据库。我使用PHP 37年5月5日已取消Mediawiki登录以防止会话劫持
每次我尝试登录到一个帐户,我得到的错误:
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.
很显然,我正在寻找的行为是登录
。我已经试过:
- 改变
$wgMainCacheType
和$wgSessionCacheType
到的各种排列CACHE_NONE
,CACHE_ACCEL
,CACHE_DB
和CACHE_ANYTHING
。 - creating a tmp directory并设置其权限。
- 重建我的
LocalSettings.php
文件。 - 在php.ini
我检查了,我知道我启用了Cookie设置session.referer_check=off
(我能叫document.cookie;
和找回数据)。
此问题已在here之前询问,并且链接的问题在内,但没有解决方案解决了我的问题。他们还处理较旧版本的WikiMedia,但我不知道在这种情况下是否会产生影响。
编辑:我也尝试创建一个新帐户时得到相同的行为。但是,我可以在没有任何错误的情况下浏览wiki,创建页面和编辑页面。
这里是我的请求头:
Cache-Control: private, must-revalidate, max-age=0
Connection: close
Content-language: en
Content-Type: text/html; charset=UTF-8
Date: Thu, 10 Aug 2017 13:48:36 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Link: </<path>/resources/assets/logo.png?88d75>;rel=preload;as=image
Server: Apache
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
Set-Cookie: <wikiname>_session=n7gs0ct99ck5i2juq0togto9q7bfou6u; path=/; secure; httponly
Transfer-Encoding: chunked
Vary: Accept-Encoding,Cookie
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Powered-By: PHP/5.5.37 ZendServer/8.5.5
X-UA-Compatible: IE=Edge
这里是我的响应头:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:ZDEDebuggerPresent=php,phtml,php3
Host:tdidev:10080
Referer:http://<wikiepath>/index.php?title=Special:UserLogin&retirnto=Main+Page
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36
你能提供的'authentication','login','session','缓存的输出'和'objectcache' [日志频道](https://www.mediawiki.org/wiki/Manual:$wgDebugLogGroups)以及尝试登录时的HTTP请求和响应标头? – Tgr
这是您提交登录表单的请求吗?如果是这样,它缺少登录cookie。因此,MediaWiki没有设置它(出于某种原因,请检查上一个请求中的Set-Cookie头,最初显示登录页面的位置),或者由于某种原因,浏览器不保留它([T151770](https ://phabricator.wikimedia.org/T151770)是Firefox的一个已知问题,可能导致这种情况)。 – Tgr
呃,对不起,我的意思是在登录页面显示给你的响应中检查“Set-Cookie”。所以它应该看起来像这样:'GET Special:UserLogin' - >'HTTP 200 Set-Cookie:SomeWiki_session:xxxxx' - >'POST Special:UserLogin Cookie:SomeWiki_session:xxxxx' - > HTTP 302 Set-Cookie :SomeWiki_user:xxx位置:Main_Page' – Tgr