Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=60824 Correctly cache the Subject in the session - if there is a session - when running under a SecurityManager. Patch provided by Jan Engehausen.