The script:

- may call ScriptCookie() during script initialization and save the resulting cookie string
- may use the cookie string to register to core pcb-rnd infrastructure that requires cookie, such as <act>CreateMenu</act>
- can depend on pcb-rnd to call any unregistering associated with this specific cookie atomatically after script unload (<act>preunload</act>).

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