Closed j9a12c20k closed 1 year ago
@j9a12c20k on the tls-client-api there is no endpoint to add cookies to a session. only an endpoint to get cookies from a session.
you need to add the cookies to the actual forward request (your create session step).
The field is: "requestCookies"
and this is an array of cookie objects.
"requestCookies": [
{
"name": "",
"value": ""
},
{
"name": "",
"value": ""
}
]
Works thank you
Hello,
Just a question not issue, how do I add cookie to session? I am trying to add it like this however its not adding cookies.
setsession localhost:8080/api/forward payload: { "tlsClientIdentifier": "chrome_110", "requestUrl": "http://httpbin.org/cookies", "sessionId": "2", "followRedirects": true, "requestMethod": "GET", "withRandomTLSExtensionOrder": true }
setcookies localhost:8080/api/cookies payload: { "sessionId": "2", "cookies": [ { "name": "cookieName", "value": "cookieValue" } ] }
now it should have set the cookies however when i see the body its empty
getcookies localhost:8080/api/forward payload: { "tlsClientIdentifier": "chrome_110", "requestUrl": "http://httpbin.org/cookies", "sessionId": "2", "followRedirects": true, "requestMethod": "GET", "withRandomTLSExtensionOrder": true }
response "body": "{\n \"cookies\": {}\n}\n"
Expected "body": "{\n \"cookies\": {\n \"cookieName\": \"cookieValue\"\n }\n}\n"