v1.0.x: refactor cookie tools