The script:

The function can not be called outside of script initialization. The cookie string can be used any time between script load and script unload.