@RequestMapping("/logout")
    public String logout() {
        SecurityUtils.getSubject().logout();
        return "redirect:/";
    }
Web MVC controller that handles security-related web requests, such as login and logout.
samples/spring-hibernate/src/main/java/org/apache/shiro/samples/sprhib/web/SecurityController.java