1

My question I believe is pretty simple, yet I haven't found a good answer.

At an e-commerce website, when you purchase a product he will set a cookie with the info of the family product the user has bought. Ok. Thing is, how to get this info from the cookie and return that to the customer browser via javascript or jquery (I can only work on the client side) like: "Congratulations on your new PRODUCT NAME"?

I am a newbie on js and programming, so please forgive is that was answered somewhere or really basic stuff. But I haven't found a good explanation on how to retrieve information from a cookie and return it to the user.

Thanks a lot!

2 Answers 2

2

This is a pretty good overview: Peter-Paul Koch's Cookies

it got functions and everything.

Sign up to request clarification or add additional context in comments.

Comments

1

If you are using jQuery, check out this plugin. The use is pretty straightforward, just follow the instruction in the readme. In your case, if the product name is saved in a cookie named "product_name", all you need to do to get this info is:

$.cookie('product_name');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.