24 lines
386 B
TypeScript
24 lines
386 B
TypeScript
import Cookies from "js-cookie";
|
|
|
|
export const cookiesStorage: Storage = {
|
|
length: 0,
|
|
clear() {
|
|
return;
|
|
},
|
|
key(index) {
|
|
return null;
|
|
},
|
|
removeItem(key) {
|
|
Cookies.remove(key);
|
|
},
|
|
setItem(key, state) {
|
|
return Cookies.set(key, state, {
|
|
expires: 7,
|
|
sameSite: "strict",
|
|
});
|
|
},
|
|
getItem(key) {
|
|
return Cookies.get(key) as string;
|
|
},
|
|
};
|