Casperjs login: Does casperjs manage cookies?

casperjs, cookies

Solution

If you want to store cookies in CasperJS, you can use the PhantomJS cookiejar, which is accesible natively through CasperJS.

Simply add following option when you launch CasperJS:

--cookies-file=cookies.txt

Your cookies will be stored in that file. Even after exiting CasperJS, if you call CasperJS with this option, you'll have access to those cookies again.

Hope that helps.

Problem

I want my casper to log in and stay logged in during the session. Is it possible? If so, how?

Original source

Related problems