Make build_cookie public