Skip to content
Snippets Groups Projects
Commit 04b021c7 authored by Recolic Keghart's avatar Recolic Keghart
Browse files

Allow modifying cookies

parent e228016f
No related branches found
No related tags found
No related merge requests found
......@@ -109,7 +109,7 @@ function storeInBrowserStorage(item, callback_function) {
function cookie_keyvalues_set(original_cookies, key, value) {
let new_element = key + "=" + value; // not used if value is undefined.
let cookies_ar = original_cookies.split(";").filter(e => e.trim().length > 0);
let selected_cookie_index = cookies_ar.findIndex(kv => kv.startsWith(key+"="));
let selected_cookie_index = cookies_ar.findIndex(kv => kv.trim().startsWith(key+"="));
if (selected_cookie_index == -1)
cookies_ar.push(new_element);
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment