Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract Firefox session cookie (python language preferred)

I'm trying to extract FF cookie from it's database (cookies.sqlite). However, seems that only cookies with expiration date can be found there (I am searching the one that expires when session ends). I even turned the "remember open tabs" feature of FF on. I don't get it - what's the fundamental difference between them. I can see the cookie in FF UI but cannot find on the hard drive.

Any anwers appreciated.

like image 835
user690954 Avatar asked Apr 04 '11 11:04

user690954


2 Answers

Session cookies are stored in the sessionstore.js file.

This file is essentially a JSON object. If you parse it, look under windows[0].cookies to get an array of the session cookies.

Typically the only fields in each session cookie are {name, host, path, value}, but occasionally you see an httpOnly parameter.

like image 177
Farlan Avatar answered Oct 04 '22 23:10

Farlan


I was looking for the same thing and found this: http://blog.mithis.net/archives/python/90-firefox3-cookies-in-python I guess the right thing to do is to use the code to add another cookiejar backend

like image 36
nakee Avatar answered Oct 04 '22 23:10

nakee