rewriting autoCookie