From 647f47062550a3d8320b09f3ccf9cd59bfedd72a Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 8 Oct 2007 18:00:17 +0000 Subject: [PATCH] (bug 11569) API Login should return the cookie prefix --- RELEASE-NOTES | 1 + includes/api/ApiLogin.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 87b6d83116..96ec3e87e3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -110,6 +110,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API * Include svn revision number (if install is checked-out from svn) in siteinfo query. * (bug 11173) Allow limited wikicode rendering via api.php * (bug 11572) API should provide interface for expanding templates +* (bug 11569) Login should return the cookie prefix === Languages updated in 1.12 === diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index d62fbfb49b..851b531441 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -94,7 +94,7 @@ class ApiLogin extends ApiBase { $loginForm = new LoginForm($params); switch ($loginForm->authenticateUserData()) { case LoginForm :: SUCCESS : - global $wgUser; + global $wgUser, $wgCookiePrefix; $wgUser->setOption('rememberpassword', 1); $wgUser->setCookies(); @@ -103,6 +103,8 @@ class ApiLogin extends ApiBase { $result['lguserid'] = $_SESSION['wsUserID']; $result['lgusername'] = $_SESSION['wsUserName']; $result['lgtoken'] = $_SESSION['wsToken']; + $result['cookieprefix'] = $wgCookiePrefix; + $result['sessionid'] = $_COOKIE["{$wgCookiePrefix}_session"]; break; case LoginForm :: NO_NAME : -- 2.20.1