diff options
Diffstat (limited to 'webAO/utils/getCookie.ts')
| -rw-r--r-- | webAO/utils/getCookie.ts | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/webAO/utils/getCookie.ts b/webAO/utils/getCookie.ts deleted file mode 100644 index 7373688..0000000 --- a/webAO/utils/getCookie.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * read a cookie from storage - * got this from w3schools - * https://www.w3schools.com/js/js_cookies.asp - * @param {string} cname The name of the cookie to return - */ -const getCookie = (cname: string) => { - try { - const name = `${cname}=`; - const decodedCookie = decodeURIComponent(document.cookie); - const ca = decodedCookie.split(";"); - for (let i = 0; i < ca.length; i++) { - let c = ca[i]; - while (c.charAt(0) === " ") { - c = c.substring(1); - } - if (c.indexOf(name) === 0) { - return c.substring(name.length, c.length); - } - } - return ""; - } catch (error) { - return ""; - } -}; -export default getCookie; |
