Error creating json cookie with jquery

Asked

Viewed 36 times

0

I’m trying to create a simple cookie with a json key value, but I’m getting it from the browser (click on the photo):

Print do navegador

This is the plugin I’m using

Code, it goes below:

 $.cookie("gavetaMilagres", '{"sub_key_1":"sub_value_1", "sub_key_2":"sub_value_2"}'); 

I would like you to stay, for example, so:

"{\"time\": 1511524234\054 \"177.42.157.224\": 18881}"

But it’s like this:

%22%7B%5C%22sub_key_1%5C%22%3A%5C%22sub_value_1%5C%22%2C%20%5C%22sub_key_2%5C%22%3A%5C%22sub_value_2%5C%22%7D%22
  • You have to see how vc tah mounting this cookie. In the code example you only put variables: $.cookie("gavetaMilagres", '{"sub_key_1":"sub_value_1", "sub_key_2":"sub_value_2"}');

  • This is the information and the result is what you have there.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.