curl - unable to fake login
Posted: Wed Jan 14, 2009 6:17 am
Hello,
I have searched for a good part of the day yesterday, but cannot seem to find an answer to this. I hope this is an appropriate forum for my question.
I am wanting to download a blog web page using a script. It requires username and password login. I have tried the following (an example) to no avail:
curl -d username=username -d password=password http://siteurl/index.php
I then tried this hoping that I could get the session started and then go to the page:
curl -d username=username -d password=password --url http://siteurl/index.php --url http://siteurl/desired_page.php
and the same as above using -u usernameassword instead of -d
I get the pages but I am not logged in. I have tried these methods on other pages using post forms for passwords and it works fine. I have checked to the source of the login pages and I am using the correct name values for password and username. I am trying to download pages that are privy only to members, and I cannot download them
I don't believe the site is using cookies to remember my login info for a session because when I log in and out using firefox, my cookie list does not change.
I noticed that I can create a dummy html login page with just a form where I submit the same information, and can log into the index page just fine.
I cannot understand then why what I have tried using curl does not work, since it works on other sites I have tried it on.
I double checked the names and values and they are correct.
Does anyone have any ideas what is happening with this?
I have searched for a good part of the day yesterday, but cannot seem to find an answer to this. I hope this is an appropriate forum for my question.
I am wanting to download a blog web page using a script. It requires username and password login. I have tried the following (an example) to no avail:
curl -d username=username -d password=password http://siteurl/index.php
I then tried this hoping that I could get the session started and then go to the page:
curl -d username=username -d password=password --url http://siteurl/index.php --url http://siteurl/desired_page.php
and the same as above using -u usernameassword instead of -d
I get the pages but I am not logged in. I have tried these methods on other pages using post forms for passwords and it works fine. I have checked to the source of the login pages and I am using the correct name values for password and username. I am trying to download pages that are privy only to members, and I cannot download them
I don't believe the site is using cookies to remember my login info for a session because when I log in and out using firefox, my cookie list does not change.
I noticed that I can create a dummy html login page with just a form where I submit the same information, and can log into the index page just fine.
I cannot understand then why what I have tried using curl does not work, since it works on other sites I have tried it on.
I double checked the names and values and they are correct.
Does anyone have any ideas what is happening with this?