summaryrefslogtreecommitdiff
path: root/static/src/assets/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/src/assets/utils.js')
-rw-r--r--static/src/assets/utils.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/static/src/assets/utils.js b/static/src/assets/utils.js
new file mode 100644
index 0000000..96a2950
--- /dev/null
+++ b/static/src/assets/utils.js
@@ -0,0 +1,12 @@
+const cookies = {};
+const cookieKVs = document.cookie
+ .split(';')
+ .map(cookie => cookie.trim().split('=', 2));
+
+for (const i in cookieKVs) {
+ cookies[cookieKVs[i][0]] = cookieKVs[i][1];
+}
+
+export {
+ cookies,
+}