cookie-whitelist

Jimdo's internal control mechanism for all jimdo.com first party cookies

Usage no npm install needed!

<script type="module">
  import cookieWhitelist from 'https://cdn.skypack.dev/cookie-whitelist';
</script>

README

Cookie Whitelist

Jimdo's internal control mechanism for all jimdo.com first party cookies

NPM

Usage

import JimdoCookies from '@jimdo/cookie-whitelist';

JimdoCookies.setJimdoCookie('jLang', 'es', {
    sameSite: 'Lax',
});

to replace:

import Cookies from 'js-cookie';

Cookies.set('jLang', 'es', {
    sameSite: 'Lax',
});

Sets the same cookie with the same value and same options. But:

  • Checks whether the cookie name is part of the whitelist.json (whitelist.json), and, if it's not, the script throws an error
  • Take the lifetime value for that cookie from the whitelist, so the dev doesn't need to take care.
  • Also, we don't set any different lifetimes as announced in the whitelist.
  • If all jimdo repos, which set jimdo.com cookies, would consume this wrapper function, no one could trick the whitelist.
  • The whitelist could/should also be used as data source for the cookie policy at https://www.jimdo.com/info/cookies/policy/.
  • For dev purposes the usual way via js-cookie is ofc still possible.

Release

Automagically release base on these rules.

Unit tests

The units tests are part of the travis cicd pipeline. You can test locally using npm run test.