How do i get value of "id" from a session cookie "apple": Decoded below as
"{logo:"Y",id:"5555555555"}"
- I want to get value of
id ="5555555555"
fromapple
- create another persistent cookie named
banana
and place this value "id" into it which expires in 10 days.
Pasted My code below:
Var res = $.cookie("apple");
<<Code to split it and get "id">>
$.cookie('id', 'the_value', { expires: 10});
I am new to Jquery and i am trying hard to get the basics . Please help!
Parse the JSON string in the cookie, then get the
id
property from it. You can then store this in the new cookie.