Cookie Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Papajo

    #1

    Cookie Question

    This is not a a PC question but just a javascript one, this script is
    used on webtv.
    The cookie on this script can be split into 3 different memory's, what
    I am trying to do is to be able to call up a total cookie count of all 3
    memory's, so far I can get the count of only one at a time.
      I am not a real time scripter so some javascript is vague to me,
    Thanks for any help. Joe

    BTW: this tool is just a basic cookied testbed


  • clintonG

    #2
    Re: Cookie Question

    I didn't test the code with the WebTV emulator so that will be up to you
    okay?
    You will also have to modify the code to loop through the collection of
    cookies to get the count and so on and do whatever it is you need to do.
    Have a good time...

    function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie .length; // total cookie count
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cooki e.substring(i, j) == arg)
    return getCookieValue (j);
    i = document.cookie .indexOf(" ", i) + 1;
    if (i == 0) break;
    }
    return null;
    }


    --
    <%= Clinton Gallagher
    METROmilwaukee "Regional Information Services"
    NET csgallagher AT metromilwaukee. com
    URL http://clintongallagher.metromilwaukee.com/


    "Papajo" <dot4444@webtv. net> wrote in message
    news:2337-41DAA6D9-383@storefull-3336.bay.webtv. net...
    This is not a a PC question but just a javascript one, this script is
    used on webtv.
    The cookie on this script can be split into 3 different memory's, what
    I am trying to do is to be able to call up a total cookie count of all 3
    memory's, so far I can get the count of only one at a time.
    I am not a real time scripter so some javascript is vague to me,
    Thanks for any help. Joe

    BTW: this tool is just a basic cookied testbed



    Comment

    • Papajo

      #3
      Re: Cookie Question

      Thanks for your responce, I'll work on that script.

      I came up with this but I think it's giving you the total cookie count
      for your domain, well thanks again, Joe

      <input type="button" value="Cookie Count" onClick="alert( 'Cookie
      Count='+documen t.cookie.length +'')">

      Comment

      Working...