bug-wget
[Top][All Lists]
Advanced

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

overrider or append entries in cookie file with --header "cookie: xxx"?


From: Peng Yu
Subject: overrider or append entries in cookie file with --header "cookie: xxx"?
Date: Sat, 15 Feb 2020 11:46:15 -0600

Hi,

I have a cookie file. I'd like to override an entity in it or specific
an extra cookie entry with -H.

But it seems that wget just ignore what is in the cookie file if -H
"cookie: xxx" is specified. Is there a way to override entries in the
cookie file? Thanks.


$ wget --load-cookies cookie.txt --keep-session-cookies --save-cookies
cookie.txt -qO- -o /dev/null 'http://httpbin.org/cookies/set?A=1'
{
  "cookies": {
    "A": "1"
  }
}
$ cat cookie.txt
# HTTP cookie file.
# Generated by Wget on 2020-02-15 11:44:52.
# Edit at your own risk.

httpbin.org     FALSE   /       FALSE   0       A       1
$ wget --load-cookies cookie.txt --keep-session-cookies --save-cookies
cookie.txt -qO- -o /dev/null http://httpbin.org/cookies
{
  "cookies": {
    "A": "1"
  }
}
$ cat cookie.txt
# HTTP cookie file.
# Generated by Wget on 2020-02-15 11:44:53.
# Edit at your own risk.

httpbin.org     FALSE   /       FALSE   0       A       1
$ wget --header 'cookie: B=2' --load-cookies cookie.txt
--keep-session-cookies --save-cookies cookie.txt -qO- -o /dev/null
http://httpbin.org/cookies
{
  "cookies": {
    "B": "2"
  }
}
$ cat cookie.txt
# HTTP cookie file.
# Generated by Wget on 2020-02-15 11:44:53.
# Edit at your own risk.

httpbin.org     FALSE   /       FALSE   0       A       1
$ rm cookie.txt


-- 
Regards,
Peng



reply via email to

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