Skip to content

HttpServletRequest.logout() not functioning  #4760

Closed
@octopusthu

Description

@octopusthu

Summary

Fail to logout in a Spring MVC Controller via HttpServletRequest.logout().

@Controller
@RequestMapping(value = "/xxx")
public class XxxControler {
    @GetMapping(value = "/yyy")
    public String someMethod(HttpServletRequest request) throws Exception {
        request.logout();
        return "some JSP";
    }

}

Actual Behavior

SecurityContext is not cleared. The user is still treated as authenticated.

Expected Behavior

SecurityContext should be cleared and the user should be treated as unauthenticated.

Version

Spring Boot 1.5.4 (with Spring Security 4.2.3)

Metadata

Metadata

Assignees

Labels

in: webAn issue in web modules (web, webmvc)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions