Skip to content

Update CookieStorageAccessor.js #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ntorgov
Copy link

@ntorgov ntorgov commented May 12, 2023

Proper method for get

@hevilhuy
Copy link
Contributor

This seems would not work with the form

@ntorgov
Copy link
Author

ntorgov commented Jun 21, 2023

this is same function, differ only in spliting aility. it does not work with any forms

export function get(key)
{
     return document.cookie.split("; ")
         .find((row) => row.startsWith(key + "="))
         ?.split("=")[1];
}

instead of

 export function get()
 {
     return document.cookie;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants