Obviously, a person does not register a registered user if you are trying to log in again, and in fact even holds a registered user at the moment. Therefore, I am trying to force logout.
I tried:
request.getSession().invalidate();
But this does not seem to work, somehow violating the input functionality.
I was wondering if anyone has any other idea on how to get the logout out.
Edit:
try { HttpSession session = request.getSession(); EventsProcessorUtil.process(PropsKeys.LOGOUT_EVENTS_PRE, PropsUtil.getArray(PropsKeys.LOGOUT_EVENTS_PRE), request, response); String domain = CookieKeys.getDomain(request); Cookie companyIdCookie = new Cookie(CookieKeys.COMPANY_ID, StringPool.BLANK); if (Validator.isNotNull(domain)) { companyIdCookie.setDomain(domain); } companyIdCookie.setMaxAge(0); companyIdCookie.setPath(StringPool.SLASH); Cookie idCookie = new Cookie(CookieKeys.ID, StringPool.BLANK); if (Validator.isNotNull(domain)) { idCookie.setDomain(domain); } idCookie.setMaxAge(0); idCookie.setPath(StringPool.SLASH); Cookie passwordCookie = new Cookie(CookieKeys.PASSWORD, StringPool.BLANK); if (Validator.isNotNull(domain)) { passwordCookie.setDomain(domain); } passwordCookie.setMaxAge(0); passwordCookie.setPath(StringPool.SLASH); CookieKeys.addCookie(request, response, companyIdCookie); CookieKeys.addCookie(request, response, idCookie); CookieKeys.addCookie(request, response, passwordCookie); try { session.invalidate(); } catch (Exception e) { } EventsProcessorUtil.process(PropsKeys.LOGOUT_EVENTS_POST, PropsUtil.getArray(PropsKeys.LOGOUT_EVENTS_POST), request, response); } catch (Exception e) { try { PortalUtil.sendError(e, request, response); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (ServletException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } }
Gives noclassdeffounderrors to cookiekeys / processorerviceutil / ... depending on what I'm replacing at a more basic level. (e.g. moduleserviceutil with servicimpl handler and copy the function code from proeccesorserviceutil).
source share