renamed condition variables in manage_cookie()