Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I can get a cookie, ok:

wget -q --tries=5 --retry-connrefused --timeout=29 -U 'Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0' --no-check-certificate --keep-session-cookies --save-cookies cookies.txt --post-data 'email=foo@bar.com&password=ASDF' HTTPS://FOO.BAR -O - > /dev/null 2>&1

But when I try to surf with the cookie.. IT ONLY WORKS when I log in via a webbrowser too! (and if I log out of the website in the webbrowser it doesn't work anymore)

wget -q --tries=5 --retry-connrefused --timeout=29 -U 'Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0' --no-check-certificate --keep-session-cookies --load-cookies cookies.txt -p "HTTPS://FOO.BAR/somewhere" -O out.html

My question: Why does wget only work if I am logged in the website too? Maybe there is another auth mode that is only working in the browser?

share|improve this question
add comment

1 Answer 1

Sounds like they're able to detect that you're not using an actual browser, even though you're setting an explicit user agent.

I would use a tool such as Postman, a Chrome extension, to make sure you've fully captured the headers that are being sent back and forth to this site and your browser. There is likely some aspect that's different between your browser traffic and your wget traffic.

You can also use Wireshark or tshark to spy on the traffic as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.