bootstrap-cookie-consent-settings
A modal dialog (cookie banner) and framework to handle the German and EU law (as written by EuGH, 1.10.2019 – C-673/17) about cookies in a website. Based on Bootstrap 4.
Usage
Construct
Initialize the cookie consent framework with the constructor
var cookieSettings = props
You may configure the framework with the props
object. The default
configuration is
thisprops = autoShowDialog: true // disable autoShowModal on the privacy policy and legal notice pages, to make these pages readable lang: navigatorlanguage // the language, in which the modal is shown languages: "en" "de" // supported languages (in ./content/), defaults to first in array contentURL: "./content/" // this URL must contain the dialogs content in the needed languages cookieName: "cookie-consent-settings" // the name of the cookie in which the configuration is stored as JSON cookieStorageDays: 365 // the duration the cookie configuration is stored on the client
Show dialog again
On a new visit the dialog is shown automatically. For reconfiguration show the Dialog again with
cookieSettings
Read the settings
Read all cookie settings with
cookieSettings
It should return some JSON like
or
undefined
, before the user has choosen his cookie options.
Read a specific cookie setting with
cookieSettings
for the analysis
cookie settings. Also returns undefined
, before the user has choosen
his cookie options.