final HttpServletRequest request = portalRequestUtils.getCurrentPortalRequest();
final IPortletWindow internalPortletWindow = this.portletWindowRegistry.convertPortletWindow(request, portletWindow);
final IPortletEntity portletEntity = internalPortletWindow.getPortletEntity();
final IPortletEntityId portletEntityId = portletEntity.getPortletEntityId();
return new ScopingPortletSessionImpl(portletEntityId, portletContext, portletWindow, session);
}