bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Saving Cookies issue


From: Tim Ruehsen
Subject: Re: [Bug-wget] Saving Cookies issue
Date: Mon, 01 Aug 2016 16:49:09 +0200
User-agent: KMail/5.2.3 (Linux/4.6.0-1-amd64; KDE/5.23.0; x86_64; ; )

On Monday, August 1, 2016 11:52:45 AM CEST Mahfuzur Rahman wrote:
> I have to save cookies to login to a site . I used following ->
> 
> wget -d -o report.txt --keep-session-cookies --save-cookies cookie.txt \
>      --post-data 'user_name=my_user_name&user_password=my_user_pass \
>      http://www.cinehub24.com/auth/login
> 
> Output is attached as "report.txt"
> cookies generated from wget attached as "cookie.txt"
> 
> 'View page source' from firefox for that webpage attached as
> "http:_www.cinehub24.com_auth source.txt"
> 
> Complete HTML save from firefox attached as
> "loginpage_save_from_firefox.rar"
> 
> Cookies that work attached as "cookies(from browser).txt"

What is your question than ? ;-)

(Guessing) If you want to know why wget returns a different set of cookies 
(maybe non functional for logins)... basically this is because wget is not 
chrome/chromium. The server is able to recognize this and just refuses to work 
in the way you might expect.

But you could trick the server to believe you are a chromium user.
For example with -U you could pretend to be a browser - you set the User-
Agent: HTTP header with this. That is what most servers look at.

A simple way to find out which User-Agent string your browser uses:
1. open a terminal and type
        nc -l -p 12345
2. enter 'http://localhost:12345' in your browser

Now you should see on your terminal what the browser sends, e.g.
GET / HTTP/1.1
Host: localhost:12345
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like 
Gecko) Chrome/52.0.2743.82 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/
*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,de;q=0.6

Regards, Tim

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]