changed cookie retrieval to res.get_cookies