added cookie to check for authorization error.