Documentation v8.0.25

Preview Purchase

Overview

Cookie is an exclusive component of Metronic that provides a simple integrated way to manage cookies via Javascript. For more info on cookies, please visit: https://javascript.info/cookie

Usage

Cookie's Javascript bundles are globally included in all pages. However, custom cookie management will require additional JS to be included.
<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css"/>
<script src="assets/js/scripts.bundle.js"></script>

Initialization

  • Cookie is globally initialized and can be controlled via our custom get, setand removeAPI methods.
  • Cookie instances can also be controlled programmatically. See below for more info.

Methods

All Cookie components are initialized automatically, however the following are Cookie's API functionality methods for more control.
Name Description
set(name, value, options) Create a new Cookie with specified name, valueand options
var date = new Date(Date.now() + 2 * 24 * 60 * 60 * 1000); // +2 day from now
var options = { expires: date };
KTCookie.set("user_logged_in", "yes", options);
get(name) Returns the selected cookie if applicable.
KTCookie.get("user_logged_in");
remove(name) Destroys the selected cookie.
KTCookie.remove("user_logged_in");

Explore Metronic

Demo1

Demo2

Demo3

Demo4

Demo5

Demo6

Demo7

Demo8

Demo9

Demo10

demo
Coming soon

Demo11

Demo12

demo
Coming soon

Demo13

Demo14

demo
Coming soon

Demo15

demo
Coming soon

Demo16

demo
Coming soon

Demo17

demo
Coming soon

Demo18

demo
Coming soon

Demo19

demo
Coming soon

Demo20

demo
Coming soon