Please check if you can use #get_cookies from Rex::Proto::Http::Response ir make cookie parsing easier.