Skip to content

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