Firefox – How to use Firefox cookies with Wget

cookiesfirefoxwget

wget --load-cookies will load cookies as a "textual file in the format originally used by Netscape's cookies.txt file". However, Firefox keeps its cookies in an SQLite database.

Is there a way to extract the "Netscape's cookies.txt file" from the Firefox cookies.sqlite file?

Best Answer

There are cookie exporter extensions that you can use to export a cookie.txt format file that can be used with wget.

Alternatively, you can create your own. Cookies are viewable in Options / Privacy / remove individual cookies. You can find the cookie you are after and create a .txt file containing the information:

domain - The domain that created AND that can read the variable. 
flag - A TRUE/FALSE value indicating if all machines within a given domain can access the variable.  Say "true" 
path - The path within the domain that the variable is valid for.  Use / for any url
secure - A TRUE/FALSE value indicating if a secure connection with the domain is needed to access the variable. Use false to allow http://
expiration - The UNIX time that the variable will expire on.  Set something far in the future
name - The name of the variable. 
value - The value of the variable.

So one might look like this for example:

.domain.com TRUE  / FALSE 4102358400 SESSIONID dfjdfkjsjwere090fusfdkljf
Related Question