This Set-Cookie was blocked because its Domain attribute is invalid with regards to the current host URL

amol 1 Reputation point

In my application, I have Azure AD authentication OpenId connect authentication scheme, and my app is running behind the application gateway. I am facing an issue while authenticating from the application gateway URL which is public and my backend application URL is restricted for public use. For ex. this is my application gateway URL and this is for backend application

When I hit the URL in the browser I redirected to the Microsoft site for the login then I log in after successful login I am redirected to the URL, and that's where the problem starts. When I saw the response header of the in the network tab of the browser, I got this warning message "This Set-Cookie was blocked because its Domain attribute is invalid with regards to the current host URL" for the Set-Cookie header, its domain attribute was set to I think this should be the application gateway's URL which is

This issue preventing me to log into the system.

Many thanks,

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
13,584 questions
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
612 questions
{count} votes

2 answers

Sort by: Newest
  1. Mahesh Patil 0 Reputation points

    I tried the solution provided in link. after implementation now URL is not changing but getting below error:
    User's image

  2. VipulSparsh-MSFT 15,986 Reputation points

    @amol Apologies for delay on this , the scenario you are in might be an expected one. This needs some configuration changes at the Application gateway level. You can go through this to figure out what you need :