xwiki/xwiki-platform — comment on commit ecd7a65fbca422db3b1d45bebb0d9936472f4672
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/LogoutAction.java line 53
By sdumitriu:

Because session.invalidate() destroys the session, but doesn't inform the client that the old session is no longer valid. This means that the next request is going to come with the old session identifier, and if the browser is going to issue multiple requests in parallel (in the name of performance), it will actually create several sessions.

Plus, a logout action always redirects to a /view/ action, so a new session is going to be created anyway, this is just an optimization.