/** * Removes the 'rememberMe' cookie from the associated {@link WebSubject}'s request/response pair. * <p/> * The {@code subject} instance is expected to be a {@link WebSubject} instance with an HTTP Request/Response pair. * If it is not a {@code WebSubject} or that {@code WebSubject} does not have an HTTP Request/Response pair, this * implementation does nothing. * * @param subject the subject instance for which identity data should be forgotten from the underlying persistence */ protected void forgetIdentity(Subject subject) { if (WebUtils.isHttp(subject)) { HttpServletRequest request = WebUtils.getHttpRequest(subject); HttpServletResponse response = WebUtils.getHttpResponse(subject); forgetIdentity(request, response); } }
/** * Removes the 'rememberMe' cookie from the associated {@link WebSubjectContext}'s request/response pair. * <p/> * The {@code SubjectContext} instance is expected to be a {@link WebSubjectContext} instance with an HTTP * Request/Response pair. If it is not a {@code WebSubjectContext} or that {@code WebSubjectContext} does not * have an HTTP Request/Response pair, this implementation does nothing. * * @param subjectContext the contextual data, usually provided by a {@link Subject.Builder} implementation */ public void forgetIdentity(SubjectContext subjectContext) { if (WebUtils.isHttp(subjectContext)) { HttpServletRequest request = WebUtils.getHttpRequest(subjectContext); HttpServletResponse response = WebUtils.getHttpResponse(subjectContext); forgetIdentity(request, response); } }