/** * {@inheritDoc} */ @Override public void removeValueByKey(final String key) { final String oldValue = session.remove(key); logger.debug("Removed from session \"{}\" = {}", key, oldValue); } }
@Override public boolean renewSession(final PlayWebContext context) { final String oldSessionId = this.getOrCreateSessionId(context); final Map<String, Object> oldData = store.get(getPrefixedSessionKey(oldSessionId)); final Http.Session session = context.getJavaSession(); session.remove(Pac4jConstants.SESSION_ID); final String newSessionId = this.getOrCreateSessionId(context); if (oldData != null) { store.set(getPrefixedSessionKey(newSessionId), oldData); } logger.debug("Renewing session: {} -> {}", oldSessionId, newSessionId); return true; }
@Override public boolean renewSession(final PlayWebContext context) { final String oldSessionId = this.getOrCreateSessionId(context); final Map<String, Object> oldData = store.get(getPrefixedSessionKey(oldSessionId)); final Http.Session session = context.getJavaSession(); session.remove(Pac4jConstants.SESSION_ID); final String newSessionId = this.getOrCreateSessionId(context); if (oldData != null) { store.set(getPrefixedSessionKey(newSessionId), oldData); } logger.debug("Renewing session: {} -> {}", oldSessionId, newSessionId); return true; }
public Result logout() { CommonHelper.assertNotBlank(Pac4jConstants.DEFAULT_URL, this.defaultUrl); CommonHelper.assertNotBlank(Pac4jConstants.LOGOUT_URL_PATTERN, this.logoutUrlPattern); final WebContext context = new PlayWebContext(ctx(), config.getSessionStore()); final ProfileManager manager = new ProfileManager(context); manager.logout(); ctx().session().remove(Pac4jConstants.SESSION_ID); final String url = context.getRequestParameter(Pac4jConstants.URL); if (url == null) { return ok(); } else { if (Pattern.matches(this.logoutUrlPattern, url)) { return redirect(url); } else { return redirect(this.defaultUrl); } } }
@Override public void remove(String key) { Http.Context.current().session().remove(key); }