fixing the cookie manager a bit, its a little more thread safe now.