How do I make cookie’s life live longer than the browsers’ life? If I set max-age > 1000 in plugins.http.setHttpClientCookie function, the cookies get deleted when I execute plugins.http.deleteHttpClient.
a server defines the max age of a cookie, not a client, a client should just look and store that cookie on his site.
And the http plugin is a client (is a browser) so you have to get the cookie and store the cookie your self and in later use use the setHttpClientCookie to set you persisted cookie again
in other words you have to implement the persistence…
You should look at creating HTTP clients and deleting them using the HTTP plugin as installing a browser on your computer and then uninstalling it again. When you uninstall it, all the settings get deleted as well, including the cookies.
Then when you reinstall the browser again, you get a plain install, so without all the settings and cookies it had the previous time when you had it installed.
So, that is what Johan says: if you need to persists cookie values between different instantiations of HTTP Clients (virtual browsers so to speak), you need to take care of the persistancy yourself.
Paul
Thanks so much for the detailed explanation.