title: Websphere Portal JSF 2 session timeout page with button when clicked causes View Expired Exception
body: <p>I'm using Websphere Portal 8 with Primefaces 3.5. The requirement is that when the session times out, the user is redirected to a session timeout page which has a button on it that when clicked takes the user back to the login page. 
  The login page contains a portlet as does the Session Timeout page - both are within the same portlet application.
  I am redirecting to the session timeout page successfully using an ImplicitLogoutFilter:</p>
  
  <pre><code>@Override
  public void logout(HttpServletRequest request, HttpServletResponse response,        FilterChainContext filterContext, LogoutFilterChain chain) throws LogoutException, LoginException {
  chain.logout(request, response, filterContext);
  if (filterContext.getRedirectURL() != null) {
  if (logger.isLoggable(Level.FINEST)) {
  logger.logp(Level.FINEST, CLASS_NAME, MethodName.LOGOUT, "Redirecting to session timeout page: " + SESSION_TIMEOUT_PAGE_URL);
  }
  filterContext.setRedirectURL(SESSION_TIMEOUT_PAGE_URL);
  }
  }
  </code></pre>
  
  <p>The portlet on the session timeout page contains a button which calls a portlet action that redirects to the login page:</p>
  
  <pre><code>public void navigateToPortalPage(String pageUniqueName) throws RpmPortalException {
      final String methodName = "navigateToPortalPage";
      RpmPortalPage portalPage = getNavigationManager().getPortalPage(pageUniqueName, getPortletRequest(), getPortletResponse());
      try {
          FacesContext context = getFacesContext();
          if (context != null) {
              context.getExternalContext().redirect(portalPage.getUrl());
              context.responseComplete();
          }
      } catch (IOException e) {
          RpmExceptionUtils.logAndThrowException(CLASSNAME, methodName + "(" + pageUniqueName + ")", RpmErrorCode.RPM_CONFIG_00004, getLoggedinUser(), e);
      }
  </code></pre>
  
  <p>}</p>
  
  <p>However, when the button is clicked instead of going to the login page, a ViewExpired exception is thrown instead. This exception is handled by an exception handler which handles exceptions, redirecting to an error page and displaying an error to the user. </p>
  
  <p>My question is how do I avoid the ViewExpired Exception after the session has expired as I just want to be able to redirect to the login page without the ViewExpiredException occurring in this case,</p>
  
  <p>Thanks in advance for your help</p>