fix set cookies many times