The proxy is receiving two cookies (AWSALB and JSESSIONID) from backend response like below.
AWSALB=lnTSVTHpyba6/qH2QWVOVQWEuJjQi1kBnpBP5yt/l628OSKMZtEmZaGHFQojsda11Tl7cn2lOqmXAEWpTsaMyFcd6oPYNAmGZCKpc7BbGi4B+8ZQzoxw0SqbFqw; Expires=Thu,26 Jan 2020 12:21:46 GMT; Path=/,JSESSIONID=B1D80E6395A35D4210B9F254835CC627; Path=/ED; HttpOnly
We are extracting cookie value like below.
var hdr = context.getVariable('response.header.set-cookie.values')+'';
var str = hdr.substring(1, hdr.length-1).split(',');
In proxy we need to update path value of cookie JSESSIONID from /ED to / (Path=/ED; to Path=/;). This is required as our proxy base path starts with /digital. We updated the cookie value using java script and set the cookie using context.setVariable(‘response.header.set-cookie’, ); But it is setting only first value.
We tried to set two cookies using two separate headers like below.
context.setVariable(‘response.header.set-cookie.1’, );
context.setVariable(‘response.header.set-cookie.2’, );
But it also setting only the first cookie. I think comma (,) in Expires attribute (Expires=Thu,26 Jan 2020 12:21:46 GMT;) is causing is issue.
Let me know if any other approach to update the cookie value as per above requirement.
@Dino-at-Google