Uploaded image for project: 'Survey'
  1. Survey
  2. SURVEY-222

Temp cookies should be deleted upon submission

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.7.4, 2.8.0
    • 2.7.3
    • None
    • None
    • 4.4 RC2

      When we take a survey answers are saved into a temporary cookie, when finishing the survey this cookie is not deleted, so if we re-take the survey answers are already filled with previous answers.

          [SURVEY-222] Temp cookies should be deleted upon submission

          Cookie is correctly deleted but, on input blur survey_save_form_values function is called after a delay of 200ms... and the cookie is re-filled with form values.

          $j("form#survey-<xsl:value-of select="$uniqueId"/>-form :input").each(function(){
          					 var input = $j(this);
          					 var onEvent_debounced = survey_debounce(function() {
          					   survey_save_form_values ('<xsl:value-of select="survey/@id" />', '<xsl:value-of select="$uniqueId" />')
          				     }, 200);
          					 input.on('input', onEvent_debounced);
                               input.on('change', onEvent_debounced);
                               input.on('blur', onEvent_debounced);
          				}); 

          Note : It is reproductible with FF but not on Chrome

          Moreover it is better to save form values in localStorage instead of cookies.

           

          Laurence Aumeunier added a comment - Cookie is correctly deleted but, on input blur survey_save_form_values function is called after a delay of 200ms... and the cookie is re-filled with form values. $j("form#survey-<xsl:value-of select="$uniqueId"/>-form :input").each(function(){ var input = $j(this); var onEvent_debounced = survey_debounce(function() { survey_save_form_values ('<xsl:value-of select="survey/@id" />', '<xsl:value-of select="$uniqueId" />') }, 200); input.on('input', onEvent_debounced); input.on('change', onEvent_debounced); input.on('blur', onEvent_debounced); }); Note : It is reproductible with FF but not on Chrome Moreover it is better to save form values in localStorage instead of cookies.  

            laurence Laurence Aumeunier
            adelaide Adélaïde Palacios (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: