Well was wondering if this is possible at all ? The aim is to get a cookie from an external website.
But while going through the HTTP class for both Request and Response I don't think there is a method to access this cookie and I even looked into the response header and I wasn't able to find the value there.
Is there is a workaround to read the cookie ?
Best Answer
You can use
response.getHeader('Set-Cookie')
to find the cookies set by the responding site.Then you can transmit the same cookie in a subsequent request (eg to simulate a browser session)