PhantomJS sets cookies as read and write

I am trying to enter a site with phantomJS using an AUTH cookie session, I finished the code for it and everything works fine, the problem is that the website has another login system with the same cookie, after access to another page cookie will update the security authentication token, so when I add the first cookie in phantom, I see that it is set to read Only because I can’t access what is in the second login system, since the web The site is trying to update the cookie, which I added manually, but, unfortunately, it fails because the cookie is set to read only.

The code I'm using is:

phantom.addCookie({
    'name':     'some name here',   /* required property */
    'value':    'some hash here',
    'domain':   'ea.some domain here.com',           /* required property */
    'path':     '/',
    'httponly': false,
    'secure':   false,
    'expires':  (new Date()).getTime() + (10000 * 60 * 60)   /* <-- expires in 10 hour */
});

I tried to delete the session cookie before my script automatically accesses a page that requires a second Auth, but it just logs out because I need to have my old session, so it can be updated with a new authhash session .

any ideas on how to manually add cookies to update after a request from the server?

+3
source share
1 answer

I found a solution

, cookie . . - , , , cookie , phantom.clearcookies(), cookie cookie. , , , .

+1

All Articles