Azure APIM

Abhay Chandramouli 966 Reputation points

I am trying to redirect from APIM to browser using 302 in APIM. I am unable to set cookie in chrome but I am able to do the same in Safari.
Is there something I am missing.. ?


Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,845 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 69,841 Reputation points

    @Abhay Chandramouli Thanks for reaching out. Can you please share the policy that you are leveraging. To set the cookie header you can leverage the below policy.
    Set-Cookie header is supported in chrome but Starting with Chrome 52 and Firefox 52, insecure sites (http:) can't set cookies with the Secure attribute anymore.

    Let me know if the below works for you.

    <set-header name="Set-Cookie" exists-action="override">  
                   var cookie = context.Response.Headers.GetValueOrDefault("Set-Cookie","");  
                   return cookie. Replace("path=/;", "path=/myNewPath;");  
    0 comments No comments