Update to the getCookie() function

I was unable to generate tokens and save them to a tokens.json file. With this update, it now works.