Moved the header call to after setcookie, also added an exit statement.