Set-Cookie in application gateway

Deepaklal-FT 86 Reputation points
2025-04-11T17:21:38.7133333+00:00

I am routing forward masing my domain from a.abc.com to x.xyz.com.

x.xyz.com is my application gateway.

When I route I am getting an error as "this attempt to set a cookie via a set-cookie header was blocked due to user preferences". How can I set my rewrite rule here in application gateway to resolve this error?

Only one of my resource is getting 403 in this case application is not loading properly.

1

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,172 questions
Azure FastTrack
Azure FastTrack
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.FastTrack: This tag is no longer in use. Please use 'Azure Startups' instead.
79 questions
{count} votes

1 answer

Sort by: Most helpful
  1. G Sree Vidya 750 Reputation points Microsoft External Staff
    2025-04-14T04:52:57.5066667+00:00

    Hello Deepaklal-FT

    As per the error details, we request you check below details and try.

    • Disable the option "Block third-party cookies" and add your domain, including third-party cookies, to the cookie allow list.
    • Ensure the Set-Cookie header includes the correct attributes (on the backend/application) https://video2.skills-academy.com/en-us/azure/application-gateway/rewrite-http-headers-url?utm_source=chatgpt.com.
    • Create a rewrite rule in the Application Gateway to modify the Set-Cookie header and ensure proper routing.
    • Enable diagnostics in the Azure Portal: Application Gateway > Diagnostics logs > Enable ApplicationGatewayAccessLog and ApplicationGatewayPerformanceLog.
    • Check for 403 errors or blocked requests in the logs.
    • If you enabled the WAF, review WAF logs for blocked requests (e.g., due to SQL injection or cross-site scripting rules).
    • Clear browser cookies and cache, access a.abc.com and check if the resource loads without the cookie error or 403.

    I hope these steps help resolve your issue. Please let me know if you need any further assistance.

    If it was helpful, please click "Upvote and Accept Answer" on this post to let us know.

    We're here to help, so if you have any further questions, don't hesitate to ask.

    Thank You.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.