<%@ include file="/common/taglibs.jsp" %>

<%
    if (request.getSession(false) != null) {
        session.invalidate();
        Cookie terminate = new Cookie(TokenBasedRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY, null);
        String contextPath = request.getContextPath();
        terminate.setPath(contextPath != null && contextPath.length() > 0 ? contextPath : "/");
        terminate.setMaxAge(0);
        response.addCookie(terminate);
    }
%>

<c:choose>
	<c:when test="${param.forced != null}">
		<c:redirect url="${ctx}/login/?forced=true"/>
	</c:when>
	<c:otherwise>
		<c:redirect url="${ctx}/login/"/>
	</c:otherwise>
</c:choose>
