store queries in cookies