<?php
if(isset($_COOKIE['id']) AND isset($_COOKIE['sess'])){
	$_COOKIE['id'] = $db->real_escape_string(filter_var($_COOKIE['id'], FILTER_SANITIZE_STRING));
	$_COOKIE['sess'] = $db->real_escape_string(filter_var($_COOKIE['sess'], FILTER_SANITIZE_STRING));
	$query = $db->query("SELECT * FROM `users` WHERE `id`='".$_COOKIE['id']."' AND `sess`='".$_COOKIE['sess']."'");
	if($query->num_rows != 0){
		$user = $query->fetch_assoc();
	}
}
?>