Add key file generation to auth cookie