diff options
| author | stonedDiscord <Tukz@gmx.de> | 2022-08-30 20:58:25 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2022-08-30 20:58:25 +0200 |
| commit | 325aa41d1216facbb7228743930a8ad21afec7aa (patch) | |
| tree | 63e454a9f7876f4839abad79482e2171aac04df4 /webAO/utils/setCookie.ts | |
| parent | 2838fbe91a270ed3d69ac708dac85b108b6f09dc (diff) | |
convert cookie stuff to ts
Diffstat (limited to 'webAO/utils/setCookie.ts')
| -rw-r--r-- | webAO/utils/setCookie.ts | 10 |
1 files changed, 10 insertions, 0 deletions
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; |
