Package javax.servlet.http

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


        if (session != null)
        {
            try
            {
                session.invalidate();
            }
            catch (IllegalStateException ex)
            {
                if (LOG.isDebugEnabled())
                    LOG.debug("Exception thrown invalidating HttpSession.", ex);
View Full Code Here


  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    log.entering("LogoutServlet", "doGet");

    HttpSession session = req.getSession(false);
    if (session != null) {
      session.invalidate();
      log.info("user logout!");
    }
    resp.sendRedirect(Constants.HOME_PAGE_URL);
  }
}
View Full Code Here

     */
    @Override
    public void invalidateCurrentSession() {
        HttpSession session = this.getRequestSessionNeverCreate();
        if (session != null) {
            session.invalidate();
        }
    }

    /** Get a named attribute from the session. */
    @Override
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

        request.removeAttribute("dispatcher");
        request.removeAttribute("security");
        request.removeAttribute("authz");

        // now empty out the session
        session.invalidate();
        session = request.getSession(true);

        // setup some things that should always be there
        UtilHttp.setInitialRequestInfo(request);
View Full Code Here

        startVerification();

        ClusteredManager manager = newManager();
        Session session = manager.createSession(null);
        HttpSession httpSession = session.getSession();
        httpSession.invalidate();

        assertNull(manager.findSession(sessionId));
    }
   
    public void testSessionEndAccessTriggersOnEndAccess() throws Exception {
View Full Code Here

        SecurityContext sc = exchange.getSecurityContext();
        sc.logout();
        if(servletContext.getDeployment().getDeploymentInfo().isInvalidateSessionOnLogout()) {
            HttpSession session = getSession(false);
            if(session != null) {
                session.invalidate();
            }
        }
    }

    @Override
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

          servlet.log("LogoffActon: User logged off in session " +
                      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

    {
        HttpSession session = (HttpSession) getSession(false);

        if (session != null)
        {
            session.invalidate();
        }
    }

    /**
     * @since 2.0
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.