I have an REST host which after a successful login sets a cookie to expire when "browser session closes".
Based on my observation so far, this means when I restart the Orchestrator service. I need to get rid of that cookie earlier, on demand.
Are there cookie management operations available for HTTP-REST plugin? Something like restHost.deleteAllCookies() or restHost.deleteCookie(id) - I haven't been able to find anything in the documentation.
Are cookies stored as plaint text files somewhere - something I could simply delete?
How else could I delete just this one specific cookie? Or send a request without cookie header?
request = restHost.createRequest(...)
request.setHeader('Cookie', null)
does not work...
Any other ideas?
Versions:
Bump.... :// any other "sane" ideas out there?
Hey,
I have the same issue and I can't find a solution either. (vRO7.2 with HTTP REST plugin)
The target HTTP REST API I'm communicating with is returning this when I successfully login:
"Set-Cookie: SMSESSION=kp2nm98jz..................."
This is then managed and stored directly by the vRO HTTP REST plugin and I can't find a way to change it.
So if the cookie expire, the target REST API is not happy and return:
"Set-Cookie:SMSESSION=LOGGEDOFF"
If I try to change it with a new cookie:
request = restHost.createRequest(...)
request.setHeader('Cookie', "SMSESSION=6cllNvnGfj/dD......") (new valid cookie)
It is then added in the http request and not overwritten.
Here is the fiddler extract:
GET https://...... HTTP/1.1
accept: */*
Content-type: application/json
Cookie: SMSESSION=6cllNvnGfj/dD......
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_112)
Cookie: SMSESSION=LOGGEDOFF
So the target REST API is still not happy 😞
If I reconfigure the vRO REST Host, the stored cookie goes away but that's a bit annoying for automation.
Hi,
This is not very elegant, but here is a way to get rid of the cached cookie:
RESTHostManager.updateHost(RestHost)
Then you need to search the "new RestHost" to be able to use it. Starting from here:
RESTHostManager.getHosts()