reduce cookie tracking (2/4): add a way to count cookies

Change-Id: I471e284104467cd299072fbb6704f30d61e6ac02