Have you ever dreamed to use Cookies like you use LocalStorage ? hum? And If I say that this lib is very light ? hum ?
Happy Cookie Storage !
npm i @ncisrc/cookies-storage
import { cookiesStorage } from "cookies-storage"
cookieStorage.setItem(key, value);
const value = cookieStorage.getItem(key);
You can change some cookies options with the third parameter
cookieStorage.setItem(key, value, {maxAge: 60});
options = {
maxAge : 604800, // 7 days
sameSite : 'Strict',
path : '/',
secure : true,
httpOnly : false,
}
You'll find more about theses options in this page :