Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Help: I need some help with javescript cookies?

    Hi,

    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,
    sam007sam

  • #2
    Regular Coder
    Join Date
    Jun 2011
    Posts
    103
    Thanks
    0
    Thanked 13 Times in 13 Posts
    I would first start by seeing how the cookie from the searchbar is set-up using this function

    Code:
    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]+"] = ["+
                        cookiePair[1]+"]<br><br>");
       }
     }
    this will display all of the cookies stored in your computer separated by a ";"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •