View Full Version : Help: I need some help with javescript cookies?

07-02-2011, 03:54 PM

I need some help with a javascript cookie please!

Problem: I am trying to put a search result url from another website on to my own website, but when other people visit my site and click the link it opens and says it has expired (because the cookie of that other site is not on their pc!). is their a way of getting that cookie from on my pc and making it so my website puts that cookie on my visitors pc?

I want to know if it is possible and if so... how?

many thanks,

07-02-2011, 05:27 PM
I would first start by seeing how the cookie from the searchbar is set-up using this function

function getAllCookies() {
var cookies = document.cookie.replace(/ /g,"").split(";");
for (var i = 0; i < cookies.length; i++){
cookiePair = cookies[i].split("=");
document.write("["+cookiePair[0]+"] = ["+

this will display all of the cookies stored in your computer separated by a ";"