Uploaded image for project: 'Pluto'
  1. Pluto
  2. PLUTO-647

Unable to set cookie in processAction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0-M3
    • 2.0.4
    • portlet container

    Description

      Failing test case:

      1) V2AddlResponseTests_SPEC2_12_Action_cookie1 - Cookies set during the Action phase should be available to the portlet during the Render phase

      I tried to set the cookie in processAction as follows -
      Cookie c = new Cookie("tr0_cookie", "true");
      c.setPath(portletReq.getProperty("Referer"));
      portletResp.addProperty(c);

      Then in render method we try to get the cookie -
      Cookie[] cookies = portletReq.getCookies();
      System.out.println(cookies.length);
      for (Cookie c : cookies)

      { System.out.println(c.getName() + " " + c.getValue()); }

      It is not necessary that a portlet container send the cookie to client side. The cookie "tr0_cookie" is also not visible on the client side. I tried setting more parameters of cookie, but nothing worked. For e.g. -
      c.setMaxAge(100);
      c.setDomain("localhost");
      c.setVersion(0);

      I can't say for sure but, this might be a bug in pluto.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mahmedk91 Ahmed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: