I am trying to save cookies from current session of logged in user so that I could use the same to make API calls. I tried injecting JS to get the cookies but one of those is HttpOnly so it cannot be retrieved with JavaScript.
I have tried the Get Browser Data activity. I save the browser data in sessionData variable. When I log the sessionData, it shows me every other irrelevant cookie other than the one from current site. Please note that I do not have any other chrome window open. And my current chrome window is incognito. Chrome incognito is expected to have no previous cookies as per my understanding.
I went through the UiPath documentation as well as the forum but everything is outdated. I am on UiPath studio v2024.10.8.
Maybe I am missing something. I need your help with this.
How can I get cookies from current browser and log them or write them to a file?
Here is what I was doing wrong. I was logging the variable for get browser data. The log was truncated at x characters. I then used the write text file activity for the same variable as a json. And the cookies i was looking for, were there.
Steps:
Use application / browser
log in to the application if needed
get browser data and save it to a variable
write text file .. use variable .. use the one created in prev step. i used filename.json to have a JSON file.