setting advanced cookies with javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • obarash
    New Member
    • Jan 2007
    • 25

    setting advanced cookies with javascript

    I need to set a ParentCookie wich will include sub childern
    Example (in ASP):
    response.cookie s("testCookie") ("test1") = "186"
    response.cookie s("testCookie") ("test2") = "140"

    in this way i can pool all the test Cookies by accessing the testCookie
    and loop all the children

    How can i do it in javascript??
  • Logician
    New Member
    • Feb 2007
    • 210

    #2
    Originally posted by obarash
    I need to set a ParentCookie wich will include sub childern
    Example (in ASP):
    response.cookie s("testCookie") ("test1") = "186"
    response.cookie s("testCookie") ("test2") = "140"

    in this way i can pool all the test Cookies by accessing the testCookie
    and loop all the children

    How can i do it in javascript??
    A cookie is a string of the form name=value and cannot be placed into a heirachy.
    You could create a cookie of the form:
    Code:
    testCookie="test1=186,test2=140"
    then parse the different values.

    Comment

    • obarash
      New Member
      • Jan 2007
      • 25

      #3
      I thing it will cause a problem

      I'm writing the cookie with javascript but
      I read it in asp in the next form

      for each test in Request.Cookies ("testCookie ")

      with testCookie="tes t1=186,test2=14 0"
      I'll need to read all the cookie and split it by "," it is very simple
      but i'm trying to avoide of changing 3 different files

      Comment

      • obarash
        New Member
        • Jan 2007
        • 25

        #4
        Thank you!

        I've tried the way you suggested and it works fine with my old asp code.

        Thanks

        Comment

        Working...