More robust cookie parsing