From f117c0f7a6fa49d2ae6d38216575beb982269638 Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Mon, 3 Dec 2007 18:50:53 +0000 Subject: [PATCH] In API action=login, make attribute sessionid work if a session ID doesn't exist yet. --- RELEASE-NOTES | 3 ++- includes/api/ApiLogin.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0896f4980f..fd07d25932 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -316,7 +316,8 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API * Add rvtoken=rollback to prop=revisions * Add meta=allmessages to get messages from site's messages cache. * Use bold and italics highlighting only in API help -* Added action={block,changerights,delete,move,protect,rollback,unblock,undelete} and list={blocks,deletedrevs}\ +* Added action={block,changerights,delete,move,protect,rollback,unblock,undelete} and list={blocks,deletedrevs} +* Fixed sessionid attribute in action=login === Languages updated in 1.12 === diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index 7d781240bd..2a47d0a4b7 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -104,7 +104,7 @@ class ApiLogin extends ApiBase { $result['lgusername'] = $_SESSION['wsUserName']; $result['lgtoken'] = $_SESSION['wsToken']; $result['cookieprefix'] = $wgCookiePrefix; - $result['sessionid'] = $_COOKIE["{$wgCookiePrefix}_session"]; + $result['sessionid'] = session_id(); break; case LoginForm :: NO_NAME : -- 2.20.1