API talk:Logout

From MediaWiki.org
Jump to: navigation, search

Does this invalidate the session/editing token?Smallman12q 19:24, 24 January 2010 (UTC)

Should this be clearing the cookies? My cURL cookies.txt has remained in tact even after calling the logout action:

function logout(){
  echo "Logging out<br/>";
  $url = $settings['wikiroot'] . "/api.php?action=logout";
  httpRequest($url);
  echo "Request complete<br/>";
  session_destroy();
}
logout();
$url = $settings['wikiroot'] . "/api.php?format=json";
$post = "action=query&meta=userinfo&uiprop=groups|rights|options";
$dat = httpRequest($url, $post);
if(empty($dat)){
  die("No data received");
}
$json = json_decode($dat);
$user = $json->query->userinfo;
echo json_encode($user);

httpRequest source can be found here: User:Bcoughlan/Login_with_curl (13:57, 28 July 2010 MTN)

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox