Cookie header getting truncated

Hello,

I am trying to access the cookie header from the js

> context.getVariable('request.header.cookie')

Looks like the cookie value i read is truncated

for eg, in trace i see cookie values as

__kti=xxx,https%3A%2F%2Fyy%2Flogin,https%3A%2F%2Fdgg%2Fsignup; __ktv=sdg; __lc.visitor_id.dg=xxxx; __utma=wfsdd; _ga=dddd; q=cvvvvv

but request.header.cookie is only this - "__kti=yyy"

It was working before, it stopped working today - anything changed?

Thanks,

Mukundha

Solved Solved
0 2 1,690
1 ACCEPTED SOLUTION

Are you sure you got cookie as below earlier?

context.getVariable('request.header.cookie')

You want to test

context.getVariable('request.header.cookie.values')+'';

Also follow below post which has details as how to extract multi value headers.

https://community.apigee.com/articles/2319/how-to-handle-multi-value-headers-in-javascript.html

-Vinay

View solution in original post

2 REPLIES 2

Are you sure you got cookie as below earlier?

context.getVariable('request.header.cookie')

You want to test

context.getVariable('request.header.cookie.values')+'';

Also follow below post which has details as how to extract multi value headers.

https://community.apigee.com/articles/2319/how-to-handle-multi-value-headers-in-javascript.html

-Vinay

Thanks Vinay, I finally did the - request.header.cookie.values as described by @Dino in the article.

request.header.cookie - worked or atleast seemed to work for a while until today, will check with support