fix cookie_expires not respected and add delay option