In my web application when I tries to logout it goes to j_spring_security_logout
instead of the given page.
In my spring-security.xml
page i have a
A better approach to use default logout url would be
<c:url var="logoutUrl" value="j_spring_security_logout"/>
<form action="${logoutUrl}" method="post">
<input type="submit" value="Log out" />
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>
When you have Spring Security CSRF protection enabled, you must logout with POST:
<c:url var="logoutUrl" value="/logout"/>
<form action="${logoutUrl}" method="post">
<input type="submit" value="Log out" />
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>