Well, it is really quite simple...
You keep all the cookies for yourself, and invite your friends over to watch you eat them, after you finish eating them all you have no cookies and you probably won't have friends anymore either... Problem solved.
The actual answer was to give a cookie named no cookie to a friend named no friend. XD