-
Notifications
You must be signed in to change notification settings - Fork 5.7k
PhantomJS does not preserve session cookie when using --cookies-file #12277
Comments
For what it is worth I've solved the problem: Thanks |
You can post out a nice tutorial to use phantom generated cookie file , which can be used in curl , or for selenium |
it's better way add option |
can i set this option this way if using php-webdriver
|
Error: Unknown option: cookies-keep-session |
@radarhere @spedy |
I also need something like --cookies-keep-session and don't think that the solution should be to comment out the line and create your own build (especially since I need a WIN build without purgeSessionCookies() call :/). The problem is not just reusing/restarting the EXE that wipes them out, but even using the WebDriver on Windows (2.1.1), I don't think I have ever ran 100 URLs through it without the process crashing. It can be detected and restarted, but then you are back to square one with Session Cookies... Has there been any solutions to this since? |
why this issue is closed? what is the solution? |
// private: |
Hello, I'd like to start by thanking all of those who contributed to this awesome software.
I am trying to write a little script that logs in to a website and does a set of actions, but I need to preserve the session cookie so I can use it for other instances.
The website I am logging to, does not support authentication using cookies "Only session cookie", so there is no "Remember me" Option to use here.
I have searched or this issue but no solution came up, so I wanted to try and "Manually" add the session cookie hoping this will solve it, cos if it does, then I will be handling the session cookie manually, so I went ahead and added this to my script (before page.open):
But it did not work.
And to clear things up, I used to do this with cURL, saving the cookie jar, and sure enough the session cookie is saved there as well, so I used to perform my actions using cURL, but now that there are JS actions to be made I have to use PhantomJS
So to sum up my issue, I am posting login data, taking a screenshot and sure enough I'm logged in, phantom is only saving cookies in --cookies-file, but not session cookie (cos it is purging it according to the output when using --debug=true), is there an option? A switch, or a workaround to make PhantomJS save and load session cookies?
P.S: While I know this might not technically an "issue", I think it still is, I understand that by being a headless browser it needs to act like one, thus deleting session cookies when the browser is closed, but as it is for developers I think an option for this should be present to help developers with a case like mine.
Thanks
The text was updated successfully, but these errors were encountered: