reading third party cookies

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rohitchawla
    New Member
    • Jul 2007
    • 85

    reading third party cookies

    How is it possible to read the third party cookies if u have a valid p3p policy set in place

    I have a server side application that sets the third party cookie and whenever the client visit any site with my js file attached to it, i want to read the values of my third party cookie

    Is it possible to read it from client side as my server side can read the value of this third party cookie
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use Ajax for this.

    Comment

    • rohitchawla
      New Member
      • Jul 2007
      • 85

      #3
      well, is there a way i can just read the value of cookie from document.cookie or any similar approach and not ask server side to fetch the values of cookies

      Comment

      • rnd me
        Recognized Expert Contributor
        • Jun 2007
        • 427

        #4
        Originally posted by rohitchawla
        well, is there a way i can just read the value of cookie from document.cookie or any similar approach and not ask server side to fetch the values of cookies
        .js files don't get cookies, no directly the answer is no.
        javascript can only view cookies in the page url's domain.
        your server cookies are only available when the page comes from you,
        they are not attachments that follow the document's scripts.

        one thing you might try playing with is using your .js file to always add an invisible iframe to the page. pointing the iframe to your server, the script could read any cookies you previously wrote. in this way, you could report back to your server whenever someone used your script file, but i am not sure if this helps you out.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Originally posted by rohitchawla
          well, is there a way i can just read the value of cookie from document.cookie or any similar approach and not ask server side to fetch the values of cookies
          I doubt it. It's not too difficult getting values from a server-side script and the delay is minimal.

          Comment

          • rohitchawla
            New Member
            • Jul 2007
            • 85

            #6
            ok thanks
            now ill try working with ajax

            Comment

            Working...