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.
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);