diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-process.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-process.jsp index 382966995ab..ae3bfd12a00 100644 --- a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-process.jsp +++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-process.jsp @@ -361,7 +361,7 @@ } String domainName = application.getInitParameter(AUTO_LOGIN_COOKIE_DOMAIN); String hostName = ServiceURLBuilder.create().build().getProxyHostName(); - String cookieDomain = IdentityUtil.isSubdomain(domainName, hostName) ? domainName : hostName; + String cookieDomain = IdentityUtil.isSubdomain(domainName, hostName) ? domainName : IdentityUtil.getRootDomain(hostName); JSONObject contentValueInJson = new JSONObject(); contentValueInJson.put("username", tenantAwareUsername);