title: Liferay Form post activated only on clicking the submit button 2 times?
body: <p>I'm posting password via Liferay form and storing it in session called <strong>"password"</strong>,
  when I'm putting the correct password which I made it as a default for now <strong>"1234"</strong> the session gets activated
  and when I browse across the pages it's working fine.</p>
  
  <p>But when I'm posting it for the first time, it doesn't work, I need to click 2 times on the button so I can see the data or if I go to another page.</p>
  
  <p>Can anyone here support me in this. This is my full code:</p>
  
  <pre><code>&lt;%
  String value = BeanParamUtil.getString(article, request, "structureId");
  %&gt;
  
  &lt;portlet:actionURL secure="&lt;%= PropsValues.COMPANY_SECURITY_AUTH_REQUIRES_HTTPS || request.isSecure() %&gt;" var="SecondloginURL"&gt;
      &lt;portlet:param name="saveLastPath" value="0" /&gt;
      &lt;portlet:param name="struts_action" value="/journal_content/view" /&gt;
  &lt;/portlet:actionURL&gt;
  
  &lt;c:choose&gt;
      &lt;c:when test="&lt;%= value.equals(\"10801\") %&gt;"&gt;
          &lt;%
              HttpSession session1 = request.getSession(false);
              out.print(session1 + "&lt;br&gt;");
              String sessionId = session1.getId();
              out.print(sessionId + "&lt;br&gt;");
              String foo = (String) session1.getAttribute("password");
              out.print(foo + "&lt;br&gt;");
          %&gt;
          &lt;c:choose&gt;
              &lt;c:when test="&lt;%= !Validator.isNull(foo) %&gt;"&gt;
                  &lt;h2&gt;this is the second password and it's working&lt;/h2&gt;
                  &lt;div class="journal-content-article"
                       id="article_&lt;%= articleDisplay.getCompanyId() %&gt;_&lt;%= articleDisplay.getGroupId() %&gt;_&lt;%= articleDisplay.getArticleId() %&gt;_&lt;%= articleDisplay.getVersion() %&gt;"&gt;
                      &lt;%= RuntimePortletUtil.processXML(application, request, response, renderRequest, renderResponse, articleDisplay.getContent()) %&gt;
                  &lt;/div&gt;
              &lt;/c:when&gt;
              &lt;c:otherwise&gt;                    
                  &lt;aui:form action="&lt;%= SecondloginURL %&gt;" name="auth" method="POST"&gt;
                      &lt;aui:input label="Second Password" type="password" name="password" /&gt;
                      &lt;aui:button type="submit" value="authenticate" onClick="location.reload(true)" /&gt;
                  &lt;/aui:form&gt;
  
                  &lt;% 
                  String pass = request.getParameter("password"); 
                  out.println(pass+" = 1234"); 
                  %&gt;
  
                  &lt;c:if test="&lt;%= Validator.equals(pass, \"1234\") %&gt;"&gt;
  
                      &lt;%  
                      session1.setAttribute("password","authenticated");
                      %&gt;
  
                  &lt;/c:if&gt;
              &lt;/c:otherwise&gt;
          &lt;/c:choose&gt;
      &lt;/c:when&gt;
      &lt;c:otherwise&gt;
          &lt;div class="journal-content-article"
               id="article_&lt;%= articleDisplay.getCompanyId() %&gt;_&lt;%= articleDisplay.getGroupId() %&gt;_&lt;%= articleDisplay.getArticleId() %&gt;_&lt;%= articleDisplay.getVersion() %&gt;"&gt;
              &lt;%= RuntimePortletUtil.processXML(application, request, response, renderRequest, renderResponse, articleDisplay.getContent()) %&gt;
          &lt;/div&gt;
      &lt;/c:otherwise&gt;
  &lt;/c:choose&gt;
  </code></pre>
  
  <p>I'm doing a <strong>hook</strong> on the <strong>journal_content/view</strong></p>