Package javax.servlet.http

Examples of javax.servlet.http.HttpSession.invalidate()


        }

        // Process user logoff by removing session attributes
        session.removeAttribute(Constants.SUBSCRIPTION_KEY);
        session.removeAttribute(Constants.USER_KEY);
        session.invalidate();

        // Done
        return doFindSuccess(mapping);

    }
View Full Code Here


              if (currentInactiveTime > maxInactiveTime) {
                if (LOG.isDebugEnabled()) {
                  LOG.debug("The underlying HttpSession is expired and "
                      + "should be invalidated.");
                }
                httpSession.invalidate();
                httpSession = getHttpServletRequest().getSession(create);
              }
//              httpSession.invalidate();
//              httpSession = getHttpServletRequest().getSession(create);
//END PATCH
View Full Code Here

                          session.getId());
            }
  }
  session.removeAttribute(Constants.SUBSCRIPTION_KEY);
  session.removeAttribute(Constants.USER_KEY);
  session.invalidate();

  // Forward control to the specified success URI
  return (mapping.findForward("success"));

    }
View Full Code Here

            resp.setContentType("text/plain");
            resp.setCharacterEncoding("UTF-8");
            PrintWriter pw = resp.getWriter();

            HttpSession session = req.getSession(true);
            session.invalidate();

            // Ugly but the easiest way to test of the session is valid or not
            boolean result;
            try {
                session.getCreationTime();
View Full Code Here

                log("WARNING: can't invalidate null session " + sessionId);
              }
                continue;
            }
            try {
        session.invalidate();
        ++nbAffectedSessions;
              if (debug >= 1) {
                  log("Invalidating session id " + sessionId);
              }
      } catch (IllegalStateException ise) {
View Full Code Here

        // if this was an anonymous checkout process, go ahead and clear the session and such now that the order is placed; we don't want this to mess up additional orders and such
        HttpSession session = request.getSession();
        GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
        if (userLogin != null && "anonymous".equals(userLogin.get("userLoginId"))) {
            // here we want to do a full logout, but not using the normal logout stuff because it saves things in the UserLogin record that we don't want changed for the anonymous user
            session.invalidate();
            session = request.getSession(true);

            // to allow the display of the order confirmation page put the userLogin in the request, but leave it out of the session
            request.setAttribute("temporaryAnonymousUserLogin", userLogin);
View Full Code Here

        //Generate any messages required
        ServiceUtil.getMessages(request, callResult, null);

        // wipe the session
        if (("anonymous".equals(currentUser.getString("userLoginId"))) || (currentUser.getString("userLoginId")).equals(userLogin.getString("userLoginId"))) {
            session.invalidate();
        }
        //Determine whether it was a success or not
        if (callResult.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR)) {
            result = (String) callResult.get(ModelService.ERROR_MESSAGE);
            request.setAttribute("_ERROR_MESSAGE_", result);
View Full Code Here

            if (currentInactiveTime > maxInactiveTime) {
              if (LOG.isDebugEnabled()) {
                LOG.debug("The underlying HttpSession is expired and "
                    + "should be invalidated.");
              }
              httpSession.invalidate();
              httpSession = getHttpServletRequest().getSession(create);
            }
        }
        if (httpSession == null) {
            if (LOG.isDebugEnabled()) {
View Full Code Here

  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    final HttpSession session = request.getSession(false);
    if (session != null) {
       session.invalidate();
      LOG.info("session killed");
    } else {
      LOG.info("no session to kill");
    }
    response.getOutputStream().write("session killed".getBytes());
View Full Code Here

  public String resetSession() throws IOException {
    LOG.info("Resetting the session.");
    FacesContext facesContext = FacesContext.getCurrentInstance();
    HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false);
    if (session != null) {
      session.invalidate();
    }
    ExternalContext externalContext = facesContext.getExternalContext();
    externalContext.redirect("/" + externalContext.getRequestContextPath());
    facesContext.responseComplete();
    return null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.