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:
| Name | Type | Description |
|---|---|---|
key | str | Cookie 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:
| Name | Type | Description |
|---|---|---|
key | str | Cookie 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:
| Name | Type | Description |
|---|---|---|
key | str | Cookie 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:
| Name | Type | Description |
|---|---|---|
key | str | Cookie key name |
val | str | Value to save |
GAME.COOKIES.save("key", 100);