use thread safe formatter
Merge pull request #544 from darkv/cookie_patch

use thread safe formatter