adding persistent cookie support, in #1