@Override
    protected SubjectContext copy(SubjectContext subjectContext) {
        if (subjectContext instanceof WebSubjectContext) {
            return new DefaultWebSubjectContext((WebSubjectContext) subjectContext);
        }
        return super.copy(subjectContext);
    }
@deprecated as of 1.2.  This should NOT be used for anything other than determining if the sessionMode has changed.
web/src/main/java/org/apache/shiro/web/mgt/DefaultWebSecurityManager.java