Where are cookies created in Javascript stored?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TimSki
    New Member
    • Jan 2008
    • 83

    Where are cookies created in Javascript stored?

    Hi,

    In my application i create a cookie using javascript using a function like this.

    [CODE=javascript]function setCookie(c_nam e,value,expired ays)
    {
    var exdate=new Date();
    exdate.setDate( exdate.getDate( )+expiredays);
    document.cookie =c_name+ "=" +escape(value)
    +((expiredays== null) ? "" : ";expires="
    +exdate.toGMTSt ring());
    //alert ("date=" + exdate.toGMTStr ing());
    }
    [/CODE]
    The problem is i can't find it on the machine (Vista ie7). Cookies created using asp scripts show under the temporary internet files but seemingly not those created using javascript.

    Can anyone tell me where they are stored pls...

    Thanks
    Last edited by acoder; Jun 5 '08, 03:22 PM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    It varies depending on the browser and the OS. In XP, IE would store in "Documents and Settings". I'm not sure about Vista. Other browsers may store in, for example, the Application Data folder.

    Comment

    • TimSki
      New Member
      • Jan 2008
      • 83

      #3
      well i feel i've searched everywhere. i can see other cookies in various folders but not t the javascript one. Clearly, it's there somewhere as otherwise the application wouldn't work. Is it possible that is is strored as a session cookie ? That said it still persists if i close bowser and/or reboot my pc ???

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        You may have to unhide hidden folders. If this doesn't help, you may get a good response in the Windows forum since this seems to be a Vista issue.

        Comment

        • TimSki
          New Member
          • Jan 2008
          • 83

          #5
          no it's not a vista issue, i have the same problem in xp. I've tried searching all hiffen folders also but to no avail...

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Just so that this doesn't end up being much ado about nothing, why exactly do you need to know where the cookies are stored? If you want to read or delete them, you can use JavaScript to do that.

            Comment

            Working...