Skip to content

Cookie Manager — Reference

Reference · Advanced · App Connect

Read and write browser-visible cookies through App Connect.

Read and write browser-visible cookies through App Connect.

  • An App Connect page with the State Management component included. Use a dedicated test key for experiments.

Read and write browser-visible cookies through App Connect.

Part Meaning
IDThe component name used in expressions, for example cookieState.
Define CookiesDeclares cookie names/schema for the editor’s pickers. It does not create a cookie. Set the page App ID before defining this metadata.
ValuesRead a value through cookieState.data.name, such as cookieState.data.wappler_docs_preference. Values are decoded strings; they are not automatically converted to booleans or objects.
Set: Name / ValueWrites the selected cookie name and a string representation of the supplied value.
Set: ExpiresOptional expiration. The runtime accepts a date value or numeric day count. A numeric 7 means seven days; a string is parsed as a date instead. Omission creates a session cookie rather than guaranteeing persistence after the browser closes.
PathCookie path scope, default /. Use the same scope when removing the cookie.
DomainOptional cookie domain. Omit it for the current response/document host unless a deliberate domain scope is required.
SecureAdds the secure cookie flag when enabled; test on HTTPS.
RemoveExpires the selected cookie with the supplied path/domain options. It cannot remove an HTTP-only cookie through client JavaScript.
Remove AllIntended to remove visible cookie keys for the supplied scope. In the installed State Management 2.0.1 implementation its callback lacks the component receiver and can throw. Use individual Remove actions for known keys rather than assuming this operation succeeded.

Name the component cookieState. Define wappler_docs_preference for the picker, then call its Set action with value compact. Bind text to cookieState.data.wappler_docs_preference and confirm compact. Remove the same key with Path / and confirm it disappears. For a code-level expression, cookieState.set(‘wappler_docs_preference’, ‘compact’, {expires: 7, path: ’/’}) supplies a numeric seven-day expiry.

Browser-visible cookies can be read by client code and may be sent with matching requests. They are not a secure identity or permission store. The component refreshes its data snapshot through its own operations; do not assume a server or another script changing a cookie instantly refreshes every manager instance.

Compare URL, cookie, session and local state before choosing where application data belongs. Browser state never replaces server-side access checks.

You can use the correct data path, configure a value and verify the storage/removal scope.