Spring security's SecurityContextHolder: session or request bound?

Viewed 40368

Is the Userprincipal I retrieve from SecurityContextHolder bound to requests or to sessions?

UserPrincipal principal = (UserPrincipal) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

This is the way I access the currently logged in user. Will this invalidate if the current session is destroyed?

1 Answers
Related