diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.js index cec47088a8e..b31ccca7c41 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.cloud.user-menu/user-menu.js @@ -50,11 +50,10 @@ function onRequest(context) { var BILLING_INFO_RETRY_COUNT_KEY = 'BILLING_INFO_RETRY_COUNT_' + context.user.domain; if (viewModal.Main.Account.billingEnabled) { - var cookie = getLoginCookie(); if (!session.get(BILLING_INFO_KEY) || daysAfterLastCheck(session.get(BILLING_INFO_KEY).lastChecked) > 1) { session.put(BILLING_INFO_RETRY_COUNT_KEY, 0); var serviceUrl = viewModal.Main.Account.cloudMgtHost + "/cloudmgt/site/blocks/admin/admin.jag"; - getBillingData(serviceUrl, cookie, 1); + getBillingData(serviceUrl, getLoginCookie(), 1); } var billingInfo = session.get(BILLING_INFO_KEY); @@ -65,7 +64,7 @@ function onRequest(context) { var cloudMgtIndexPage = viewModal.Main.Account.cloudMgtIndexPage; if (!billingInfo) { - recordFirstLogin(serviceUrl, cookie, 1); + recordFirstLogin(serviceUrl, getLoginCookie(), 1); log.info("Access denied for tenant: " + context.user.domain + " with a NULL subscription. Redirected to CloudMgt"); response.sendRedirect(cloudMgtIndexPage);