protected IPentahoSession generatePentahoSession( final HttpServletRequest httpRequest ) {
HttpSession httpSession = httpRequest.getSession( false );
IPentahoSession pentahoSession = null;
if ( httpSession != null ) {
pentahoSession = new PentahoHttpSession( null, httpSession, httpRequest.getLocale(), null );
} else {
pentahoSession = new NoDestroyStandaloneSession( null );
}
if ( callSetAuthenticatedForAnonymousUsers ) {
pentahoSession.setAuthenticated( getAnonymousUser() );