checks for a cookie