<?php
//共通
require_once '../base/common.php';
$logger = new logger(basename(__FILE__));
$logger->info("===logout start===");

$response["status"] = "OK";

try {
  global $dbutil;


  $sid = session_id();
  $loginUtil = new loginUtil($dbutil, $logger);
  $retsult = $loginUtil->logout( $sid );

  // セッションクリア
  $serverUtil->deleteSession();

} catch(userException $ue) {
  $retData["code"]  = $ue->getErrorCode();
  $retData["msg"]   = $ue->getErrorMessage();

  $response["status"] = "NG";
  $response["data"]   = $retData;

  $dbutil->rollback();

} catch(Exception $e) {
  $response["status"] = "NG";
  $response["data"]   = $e->getMessage();

  $dbutil->rollback();

} finally {
  $logger->info("response", $response );
  print( json_encode($response) );
  $logger->info("=== end ===");
}




?>
