<?php
  include_once("conn.php");
  $jsondata = array();

  $ssql = "update USUARIOS SET COOKIE=NULL WHERE ID_USUARIO=" . $_SESSION['CurrentIdUser'];
  $RsLogin = $DBSegu->Execute($ssql);
  ob_start(); 
  unset($_COOKIE['cCodigo']);
  $res = setcookie('cCodigo', '', time() - 3600);
  unset($_COOKIE['cMarca']);
  $res = setcookie('cMarca', '', time() - 3600);
  ob_end_flush(); 

  $_SESSION['UsuarioValidado'] = 'NO';
  $_SESSION['CurrentUser']     = '';
  $_SESSION['CurrentIdUser']   = -1;
  $_SESSION['CurrentCorreo']   = '';
  $_SESSION['CurrentPortal']   = '';
  $jsondata['success'] = true;
  $jsondata['message'] = '';

  header('Content-type: application/json; charset=utf-8');
  echo json_encode($jsondata);
  exit();
?>  
