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

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 14.0.0
    • plugins-poll
    • None

    Description

      adouma (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

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

            Dates

              Created:
              Updated:
              Resolved: