Jump to content

Assign value to cookie


jarvis

Recommended Posts

Hi All,

 

I hope someone can help!

 

I've got some code that passes an array of values via an ajax call. This works fine and I can see my values in the specified div:

$("#container").html(data);

What I'd like to do, is get that info and pass it to a cookie. However, I'm struggling a tad. I currently have this:

var set_me = html(data);
$.cookie('choice',set_me, {expires: 7, path: '/'});
alert( $.cookie("choice") );

But sadly it's not working. I think it's something simple but this is new to me some need some help please

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/289406-assign-value-to-cookie/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.