Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the page after login? #143

Open
liang0754 opened this issue Nov 26, 2016 · 6 comments
Open

How to get the page after login? #143

liang0754 opened this issue Nov 26, 2016 · 6 comments

Comments

@liang0754
Copy link

i want the page which need user login.
example : http://www.xxx.com/user/address.html . And the login form like
{
url : http://www.xxx.com/login
post: [
username:"user1",
password:"pwd1",
]
}

@jonnnnyw
Copy link
Owner

jonnnnyw commented Dec 5, 2016

You can set a cookies file to persist sessions across requests.

$file = '/path/to/your/file.txt';

$client = $this->getClient();
$client->getEngine()->addOption('--cookies-file=' . $file);

Make sure that your file is writeable by PhantomJS.

@liang0754
Copy link
Author

i mean than how this project get the cookies which after login.

@jonnnnyw
Copy link
Owner

jonnnnyw commented Dec 6, 2016

Sorry I don't really understand what you are trying to do. Can you explain it a little more?

@pns2050
Copy link

pns2050 commented Jan 28, 2017

Hi,

Adding this option does indeed save the cookies on the $file.

But it seems that they are not used on the following requests, am I missing something?

@sFaxsy
Copy link

sFaxsy commented Mar 17, 2017

I have the same issue with my application ,

I want browse the profile page after the login , and take a screenshot , but it seems that it doesn't use the same cookie and sessions

the question : https://stackoverflow.com/questions/42848315/browsing-pages-behind-login-system-php-phantomjs

@MichaelCStevens
Copy link

Almost a year later and this issue still exists....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants