Can 'Set-Cookie' response headers be used to set cookies in Cordova?

Viewed 1288

I am using Cordova to run my React application as an app on iOS and Android. For security reasons the app's API uses cookies, rather than local storage, to store tokens. These cookies are set with the 'Set-Cookie' response header and the HttpOnly flag so that the JavaScript never has access to the tokens. I want these cookies to be stored persistently in the app so that they are used in subsequent requests, even if the app has been closed and reopened.

I understand that cookies can't work in Cordova out of the box, and I have seen plugins that set cookies from JavaScript, but is there any way that the 'Set-Cookie' headers in responses can be handled in Cordova so that the cookies can be stored in a secure place and used when required?

1 Answers
Related