From 325aa41d1216facbb7228743930a8ad21afec7aa Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 30 Aug 2022 20:58:25 +0200 Subject: convert cookie stuff to ts --- webAO/utils/setCookie.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 webAO/utils/setCookie.ts (limited to 'webAO/utils/setCookie.ts') diff --git a/webAO/utils/setCookie.ts b/webAO/utils/setCookie.ts new file mode 100644 index 0000000..084fa20 --- /dev/null +++ b/webAO/utils/setCookie.ts @@ -0,0 +1,10 @@ +/** + * set a cookie + * the version from w3schools expects these to expire + * @param {String} cname The name of the cookie to return + * @param {any} value The value of that cookie option + */ +const setCookie = (cname: String, value: any) => { + document.cookie = `${cname}=${value}`; +}; +export default setCookie; -- cgit