How to send accesstoken as a cookie to target

Hi Everyone,

I have got accesstoken from servicecallout response. Now I need to send that access token as a cookie by name 'accSkl'. I checked in AssignMessage policy but I don't find an option to set cookie there.

Please let me know how to create a cookie and send it to the target.

Thank you.

Regards

Ravi

0 1 634
1 REPLY 1

A cookie is a header.

You can use AssignMessage to set a header named "Cookie"

The structure of the cookie, the key=value pieces, is something you would need to construct.

But.

Normally the client side (in this case Apigee) doesn't independently create cookies and add them to requests. Normally the client receives a Set-Cookie header in a response from the server, and the client simply replays what it received from the server.

A client "inventing" a cookie to send to a server, normally wouldn't work properly. Your server may be different; it may be willing to accept a cookie that it did not create.