Uploaded image for project: '[Read Only] - Hippo Plugins'
  1. [Read Only] - Hippo Plugins
  2. HIPPLUG-1604

Cannot vote on a poll if you do not *yet* have any cookies locally

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 14.0.0
    • Component/s: plugins-poll
    • Labels:
      None
    • Similar issues:

      Description

      Ate Douma (I am fixing this in the securitydomain branch since so simple)

      I you do not yet have a cookie in your browser but want to vote on a poll, the code incorrectly assumes that you do not have cookie support via

      protected String getPersistentValue(HstRequest request, String pollDocumentName) {
      
              if (request.getCookies() == null) {
                  return NO_COOKIE_SUPPORT;
              }
      
              String name = getCookieName(request, pollDocumentName);
      
              for (Cookie cookie : request.getCookies()) {
                  if (name.equals(cookie.getName())) {
                      return cookie.getValue();
                  }
              }
      
              return null;
          }
      

      The workaround trick for this is to always set a dummy cookie during the rendering of the poll first. Then if cookie support is on in the browser, the vote request will have cookies for sure

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aschrijvers Ard Schrijvers
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: