Added optional persist mode. Default is session only.