less than 1 minute read

I recently had the problem that I wanted to call a URL from a shell script and thought that wget might do the job.

The site requires authentication so I thought of using my Firefox cookie for this. Bad luck, Firefox 3 now uses sqlite to store their cookies so I can’t use the cookie file directly sigh

After some extended search on the net I found several options:

  • Read the cookie from Firefox manually and add it via the ```--header``` options of wget.
1
2
3
4
5
 wget --cookies=off \
 --header "Cookie: Name=cookie_text; \
expires=Thu, 20-Jan-11 14:16:08 GMT; \
path=/; domain=.schnuckelig.eu" \
http://www.example.com/my_site.html
  • Use Export Cookies which enables you to export your cookies as the "old style" text file usable by wget
  • Use aria instead of wget, because it can read cookies from Firefox 3 files and has some nice additional features.