When I access nadex.com quotes, Firebug tells me I send these cookies (but it's really all one line):
JSESSIONID=Qk3lNyhpQCpGpfx4bghpJLd2ML90tNx3lKvpvPLcvdmJyGRGztH5!1308128606!-757\
827124; bhCookieSess=1; bhCookiePerm=1; IGFOREXCOOKIE=; LS__LSEngine_S=exist_13\
02897154477; LS__LSEngine_K=SHARE_SESSION; LS__https://demo-mdp.nadex.com=1; LS\
__LSEngine=73; iconStateSetting=/dealing/pd/cfd/login/loginUser.htm?iconsEnable\
d=true; homeUrl= showDmaHelp=fa\
lse and Firefox's "Edit/Preferences/Privacy/remove individual cookies" seems to agree.
However, when I look at cookies.sql, some cookies above don't show up:
cp ~/.mozilla/firefox/ /tmp && \
echo "SELECT name FROM moz_cookies;" | sqlite3 /tmp/cookies.sqlite |\
sort | uniq (note that I must "cp" since the original db is locked by Firefox).
The result's ugly + unhelpful, but I specifically noted these values do NOT appear even though I'd expect them to:
- JSESSIONID (probably the most important one)
- homeURL
- showDmaHelp
- possibly others
How can I find these "hidden" cookies? I'm writing a perl/curl script to download data, but it doesn't work w/o the JSESSIONID cookie (and handcopying from Firebug isn't automatic enough, plus JSESSIONID changes often)
EDIT (too long/unwieldy for a comment): @Lekensteyn Thanks for the GM script! It doesn't update webappsstore.sqlite when I visit nadex.com and login, but it DOES update sessionstore.js, which contains:
{"host":"","value":"3x0LNpvGDHQq\
xls7FxbqtJ2pFlL0gSyk9YvBkPs09r4yvQyZDMWs!-1593496027!1301994507","path":"/price\
stream","name":"JSESSIONID"}all on one line (in fact, the entire file is a single line).
However, I haven't yet checked to see if that has anything to do w/ the GM script, or is something that happens anyway. At the very least, it gives me a new place to dig.
22 Answers
I suspect that Firefox does not update the cookies.sqlite file directly for data integrity and performance reasons. Rather, it temporary stores the data in cookies.sqlite-journal (Firefox 3.x). Because the session cookies changes frequently, it is reasonable that the cookies are not present in the cookies.sqlite file. When Firefox is closed, the changes to cookies.sqlite are applied.
A workaround is available using a Greasemonkey script.
- Install the Greasemonkey add-on.
Restart Firefox. Meanwhile, save the next text as "jsessionid.user.js".
// ==UserScript== // @name JSESSIONID to localStorage // @namespace // @description Saves the JSESSIONID cookie in localStorage // @include // ==/UserScript== (function() { var sessid = document.cookie.match(/JSESSIONID=([^;]+)/); if (sessid) { var oldSID = localStorage.JSESSIONID; if (sessid != oldSID) localStorage.JSESSIONID = sessid[1]; } })();This should retrieve the session cookie right after login and store using HTML5 Storage if the session ID is different than the previously saved one. If you need to make the script save the session ID earlier, you need to modify the
@includeline to something like . I've noticed that no session ID is sent over HTTP, just HTTPS.- Open the
jsessionid.user.jsfile in Firefox (or drop it into Firefox). You'll be prompted on installing it. Accept it. In Bash, use something like:
sessid=$(sqlite3 ~/.mozilla/firefox/ "SELECT \ value FROM webappsstore2 WHERE key='JSESSIONID' AND secure='1' \ AND host LIKE 'moc.xedan.%' LIMIT 1;")moc.xedan.is a part of the domain in reverse order.
For debugging, you can use the next bookmarklet:
javascript:alert("JSESSIONID=" + localStorage.JSESSIONID);It'll display null if there is no such ID found. Note that it matters whether you execute it on or . This bookmarklet can be pasted in the location bar directly.
you can find your session id in the sessionstore.js in your profile. grep for:
{"host":"<your site>","value":"(.+)","path":"/","name":"JSESSIONID","httponly":true}with the appropriate value for as shown in the FF cookie management window.
It could well be that this only works if you have activated the session restore mechanism in the properties.