Fixed cookie handling, max-age key hast to be interger, not string