Fix cookie capturing