It would be good to reduce file writes e.g. to prolong hard disk life. What if we track when session data changes but only write the keyfile when the main window loses focus? That would seem to solve the user clicking logout problem and drastically reduce disk/network writes.