A truly revolutionary question, I'm not sure if I can help you with it but I will do my best...

So, you have 2, and your friend also has 2. Currently, at that point in time, you have only 2 cookies. However, we need to take into account the possible future events that could impact the outcome. You could steal your friends 2 cookies meaning that you would then have four, or maybe you felt nice and only took 1, meaning you would have three, or maybe you gave an amount and maybe even swapped some cookies, meaning that the molecular structure of your cookies would be changed. Technically, assuming if you both just swapped your cookies, you would have 2 cookies. However, you cannot forget about the variable that you potentially planned to swap the cookies and poisoned yours so when you switched, your friend would then proceed to eat his and get extremely sick before dying, meaning you could take the leftover one he didn't eat before he died, so, therefore, you now have 3 again. But, would the other cookie count? Or would you have 2 cookies and 1 poisoned cookie? And what if you chose to only poison one, exponentially changing the future events and possibilities that could take place?

And, of course, there is the fact that you could eat anywhere from 1 and 1/2 of a cookie to 1 and 18394652/2381628394 of a cookie, increasing the complexity of this question by an absolutely incomprehensible amount.

In conclusion, please add more detail to your question as it is impossible to answer it with the bare minimum of information you provided.