newSession.setAttribute(RegistryConstants.ROOT_REGISTRY_INSTANCE, session
.getAttribute(RegistryConstants.ROOT_REGISTRY_INSTANCE));
newSession.setAttribute(ServerConstants.USER_LOGGED_IN, session
.getAttribute(ServerConstants.USER_LOGGED_IN));
SuperTenantCarbonContext newContext = SuperTenantCarbonContext.getCurrentContext(newSession);
SuperTenantCarbonContext oldContext = SuperTenantCarbonContext.getCurrentContext(session);
newContext
.setRegistry(RegistryType.USER_GOVERNANCE, oldContext.getRegistry(
RegistryType.USER_GOVERNANCE));
newContext.setRegistry(RegistryType.USER_CONFIGURATION,
oldContext.getRegistry(
RegistryType.USER_CONFIGURATION));
newContext.setRegistry(RegistryType.SYSTEM_CONFIGURATION,
oldContext.getRegistry(
RegistryType.SYSTEM_CONFIGURATION));
newContext.setRegistry(RegistryType.SYSTEM_GOVERNANCE,
oldContext.getRegistry(
RegistryType.SYSTEM_GOVERNANCE));
newContext.setUserRealm(oldContext.getUserRealm());
newContext.setTenantDomain(oldContext.getTenantDomain());
newContext.setTenantId(oldContext.getTenantId());
String loginStatus = (String) session.getAttribute(ServerConstants.USER_LOGGED_IN);
return (loginStatus!=null);
}
return false;