For the cookies, there is some dedicated platform method to cleanup cookies for a given app.
See this piece of code for example:
http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#396