Skip to main content
Use cookie to set a browser cookie for the current host or a specified domain. The shorthand accepts a cookie string with optional attributes:
Without Domain, the cookie uses the current page’s host. Navigate to the app before setting it.

Parameters

Shorthand

Use a cookie string with optional Domain, Path, and Max-Age attributes.

Examples

To clear a cookie, set an empty value with Max-Age=0 and the same Domain and Path used when setting it. Path defaults to /.

Notes

If the app reads the cookie only when it loads, refresh the page or navigate after setting it.