Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Functionality

The setStorageType function allows the publisher to set an alternative solution to storing consent in cookies. Consent cookies currently consume about 3-4kb and are sent automatically by the browser to every request to the publisher’s main and sub-domains. This causes might cause problems as some APIs limit the amount size of HTTP header sizeheaders. Additionally, it slows down requests of the publisher because of the additional overhead, which could be potentially an issue on mobile devices.

...

This is an integer that can be either 0 or 1. A 0 value sets the consent storage to be in cookies, an and a 1 value sets the storage to be the browser browser’s local storage. Please note that if for some reason local storage is unavailable in the browser (e.g., privacy options enabled in the browser blocking local storage), the storage will default to cookie.

...

If we set the storage to be Local Storage and for some reason, the browser Local Storage is not available, the storage will fallback fall back to cookies again.

Local storage naming

The local storage uses the same naming as the cookies , but adds the prefix _sn_.

This means that the consent storage naming will be:

GDPR (EU)

  • euconsent-v2_sn_euconsent-v2

  • snconsent_sn_snconsent

...