Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1552

Wget: How do I keep cookies session alive for recursive or mirror download (--keep-session-cookies not working)

$
0
0

I'm trying use wget to download a website but it does not keep it session alive after the first Webpage its cloned, the website has a login and uses HTTPS so I wont be able to navigate trough it if its not by credentials. I managed to log into the server using cURL and saving it PHPSESSIONID into a cookie.txt So this proccess I'm doing:

First, I create a cookie.txt

wget --save-cookies=cookie.txt      --keep-session-cookies "https://huellas.dashboardtimes.com/login.php?user=MyUserName&password=MyPass"     --delete-after

No --post-data its given since the website uses a GET method to authenticate (this logs in successfully but just for the first page).

And then:

wget --load-cookies=cookie.txt -m https://Website.wget.com/home

At this point, wget clone https://Website.wget.com/home after a successful login in it with returned code 200 OK, but when it finishes /home and enters to another module like for example https://Website.wget.com/contacts it looses it's session and clone all others modules as an Error - 404 with a return code 302. I also tried to give the command a list with a couple of URLS

wget --load-cookies=cookie.txt -m -i list.txt

But I'm still getting the same results. Is there something in the -m option that could cause this?Because if I don't specify the -m option it does download the HTML file of the URLS in the list with no Error 404, but I need more than just the HTML so that why I'm using -m option.

Is there a workaround for this or am I missing something?

(If there's any other tool like wget that I can use for this I would like to know also).

Thanks for your answers.


Viewing all articles
Browse latest Browse all 1552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>