# j-Cookie2

> j-Cookie2: singleton; uses localStorage

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 70707a85b6c0394c0ff53589f3b16c7d97ed3eb30255a781d463deac355ebaba
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- singleton
- uses __localStorage__
- supports `cancel` operation (removes cookies, localStorage and redirects to `about:blank`)

__Configuration__

- `agree` {String} a label for the agree button (default: `OK`)
- `cancel` {String} a label for the cancel button (default: `Cancel`)
- `redirect` {String} URL to redirect if the user pressed cancel button (default: `about:blank`)

Use it with `<ui-component name="cookie2">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="cookie2" class="hidden">This site uses cookies for visitor statistics. By continuing to browse the site you are agreeing to our use of cookies. <a href="/privacy/">Privacy Policy</a></ui-component>

<div>CONTENT</div>
<div>CONTENT</div>
<div>CONTENT</div>
<div>CONTENT</div>
<div>CONTENT</div>
<div>CONTENT</div>
<div>CONTENT</div>
```
