You are not escaping or screening the cookie username or password before inserting their values directly into a query. This could cause broken syntax if the username or password contains a single quote ('). Worse, a smart hacker could do some SQL injection to guarantee that your query always returns a record.
You are infact using addslashes when u set the cookie, but there is nothing to stop the user from altering those cookies to be whatever they want. try removing those addslashes calls and then change your query to something like this:
$query = "SELECT * FROM `users` WHERE Uname='" . mysql_real_escape_string($_COOKIE['username']) . "' AND Rpass='" . mysql_real_escape_string($_COOKIE['password']) . "'";
Another potential problem is that your script doesn't check to make sure that any username or password is entered. I'm not sure how thorough you've been with the rest of your code, but it is potentially possible that empty rows could find their way into your table in which case leaving user and pass blank would let someone login by simply leaving those blank. It's not uncommon for garbage or empty data to find its way into a database. I would make sure strlen() for user and pass is >= 1