As far as I'm aware, there is no yet standard way to save credentials in FirefoxOS. There is no such thing as AccountManager like android. So each app has to save credentials on their own. Which means that you have to fallback to things like localstorage or indexeddb.
I'm not sure if there is a better way to handle this problem. I have an application and I'd like to save user/password to make it easier to reauth on a couchdb server.
My current solution is to create a PouchDB database that will be used only locally and a PouchDB database that can be synced with the couchdb server. Also, in theory I can bind changes event to the local private database to listen to password change to reauthenticate with different credentials. When cookie expires I can reuse the credentials to log in again and retry the request that failed.