Skip to content

$fn.setCookieContent()

This built-in function was added in v4.0.0.

A function to set cookie consent information. [Async]

Arguments

TypeDescription
ContentPrefsThe cookie consent information object to set

Example of ContentPrefs object

{
functional: true, // Functional
analytics: false, // Analytics/Performance
marketing: true // Advertising/Marketing
}

Return value

None

Example

await $fn.setCookieContent({ functional: true, analytics: true, marketing: true });

Remarks

  • The content set by this function can be retrieved with $fn.getCookieContent().
  • Cookies with the HttpOnly attribute set by the server cannot be set.