Adding useCookies param

Added a useCookies param to obtain new token, default true. Allows this to be used in background jobs which don't have web context.