In seam documentation you only see than method Identity.logout
But in not complex solution. Spending some time i found simple and pretty solution - just invoke you own logout method and in this method do Identity.instance().login();
for example:
public String logout() {
// do something before logout
String result = Identity.instance().logout();
// do something after logout
return result;
}
also you need extend logout method in Identity for postAuthenticate invoke
public void logout() {
super.logout();
super.postAuthenticate();
}
it prevent you from resend cookies back
one more thing. This is bug or not but if you use remember-me in seam logout will not work properly (JBoss Seam 2.0)