COOKIES

Cookie handling for persistent data.

Availability: Client-only

Methods


COOKIES.has

client

Check if a cookie exists (client-side only)

Signature: bool action(str)

Parameters:

NameTypeDescription
keystrCookie key name

Returns: bool - True if the cookie exists

bool result = GAME.COOKIES.has("key");

COOKIES.load

client

Load data from a browser cookie (client-side only)

Signature: str action(str)

Parameters:

NameTypeDescription
keystrCookie key name

Returns: str - The stored value

str result = GAME.COOKIES.load("key");

COOKIES.remove

client

Remove a browser cookie (client-side only)

Signature: action(str)

Parameters:

NameTypeDescription
keystrCookie key name to remove
GAME.COOKIES.remove("key");

COOKIES.save

client

Save data to a browser cookie (client-side only)

Signature: action(str, str)

Parameters:

NameTypeDescription
keystrCookie key name
valstrValue to save
GAME.COOKIES.save("key", 100);