How to clear data from Phantom Instances
If that is an issue for you, make sure you clean up any sensitive data on the phantom instance before returning it to the pool.
As mentioned in the repo, that previous instances might have data left in it, how to clear them? Could you point me to any example?
Thank you for your time. :)
I don't know how to do it but PRs are welcomed :)
I think the things which may persist on the phantom instance are Cookies and Local Storage.
For cookies, the path is clear: Call .clearCookies() before returning the instance to the pool.
For Local Storage, it seems to be a little more complicated, and I actually haven't tried to do it myself. But here are a couple articles on clearing local storage and specifically in phantomjs.
I think that would be an interesting feature to merge if someone's willing to do a PR. It would be better if that behavior was turned off by default though for backwards compatibility.