Improved handling of cookies in the request.