rewrite cookie