<?php
    include_once('conexao.php');
	include_once('DAO/DAOusuario.php');
	//include_once('classes/usuario.php');
 
	$conn         = new Conexao();
	$usuario      = new DAOusuario(); 


	if (isset($_COOKIE["usu_email"]) && isset($_COOKIE["usu_senha"])){
	    if ($_COOKIE["usu_email"]!="" || $_COOKIE["usu_senha"]!=""){
		    if ($usuario->autenticarUsuario2($_COOKIE["usu_email"],$_COOKIE["usu_senha"])) 
			    $status = true;
			else
				echo("<script language = 'javascript'> location.href = 'login.php'; </script>"); 	
	    }else 
			echo("<script language = 'javascript'> location.href = 'login.php'; </script>"); 	 
	}else{
	  
	  	echo("<script language = 'javascript'> location.href = 'login.php'; </script>"); 	
	 	exit;
	}
?>