Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8156

When cookie is set and retrieved, the value get surronded by double quotes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • No Release
    • None
    • None
    • None
    • Linux 2.6.18-92.el5xen #1 SMP Tue Apr 29 13:31:30 EDT 2008 x86_64
      JBOSS Version: jboss-eap-4.3.0.GA CP06

      When cookie is set and then get the value get surronded by double quotes.
      E.g.
      Cookie appCookie = new Cookie("applpath", "/MyAppRoot");
      resp.addCookie(appCookie);

      Accessing at client side (JS)
      function getColorCookie(sName) {
      var aCookie = document.cookie.split("; ");
      for (var i=0; i < aCookie.length; i++)

      { var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); }


      return null;
      }
      Expected Result: applpath = /MyAppRoot
      Actual Result: applpath = "/MyAppRoot"

      My inference:
      Using servlet API when cookie is stored and retrieved, the double quotes may be handled.
      When cookie is set using servlet API and read at client side (JS/Applet etc) the quotes introduced are NOT ignored.

              Unassigned Unassigned
              adeeb.in Adeeb Abdulkarim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: