I originally designed the sessions to last for 30 minutes or so, but Sandstorm has gotten more aggressive about shutting down grains. Fixing this requires some level of session persistence. My plan is to persist session encryption keys on the server, then store encrypted cookies with the database's computed key on the client. That way, the database's key is never persisted anywhere in the clear, and the persisted server keys can be rotated regularly. A compromise of the server keys is only valuable if you also compromise a client session token encrypted with the same key, but even then, the attacker can't gain the master password, just the computed key. The user could cycle their keyfile and still be fine.
I originally designed the sessions to last for 30 minutes or so, but Sandstorm has gotten more aggressive about shutting down grains. Fixing this requires some level of session persistence. My plan is to persist session encryption keys on the server, then store encrypted cookies with the database's computed key on the client. That way, the database's key is never persisted anywhere in the clear, and the persisted server keys can be rotated regularly. A compromise of the server keys is only valuable if you also compromise a client session token encrypted with the same key, but even then, the attacker can't gain the master password, just the computed key. The user could cycle their keyfile and still be fine.