There is no hint in the movie regarding the reality of the 'cookie'. All we can do is extrapolate.
In the Matrix universe, food items are often code injection tools. The red pill-blue pill semantics of Morpheus and the Merovingian's cake make it clear that food items are often used as hacking tools of the subject.
Let's recap the events leading up to the 'cookie'. Neo is brought to Oracle by Morpheus after his training. Oracle first impresses Neo by predicting the breaking of her vase. She tells him that being the ‘One’ is like being in love. She examines his face like a doctor. Then she proceeds to ask leading questions to Neo about whether he believes he is the ‘One’. When she successfully goads him into saying that he is not the ‘One’, she makes another prediction. Morpheus would try to save Neo’s life and one of them would die as a result. This choice would be Neo’s to make. When Neo’s face falls, she gives him a cookie to eat and assures him that eating it would make him feel better. She reminds him that he was in control of his own life.1
The invention of free will
Many of the events listed above have subtexts. This is what I see. The deployment of ‘free will’ in the Matrix is Oracle’s own invention. Later on in the movies, we see that the Oracle and the Architect are the two opposing forces in the Matrix. While the Architect is trying to control the Matrix centrally by making global rules, the Oracle is trying to control the Matrix in a decentralized way. The Oracle has given every human being in the Matrix a limited sense of free will, but they are still controlled by the Architect’s rules. This ‘limited free will’ was necessary to keep the human ‘crops’ from rejecting reality altogether and destroying themselves in the process. The Oracle wants a peaceful resolution to the machine human war, and thus is arming the human beings with free will. In addition to this, in every iteration of the Matrix the Oracle also has embedded the source code to reboot the Matrix in an individual called the One, giving him something like ‘sudo’ or ‘administrator rights’ or ‘absolute free will’.
I think that belief is the central theme of the Matrix movies. They are deeply religious in that sense. The Oracle has Morpheus convinced that he will find the One. It is belief that the Oracle tries to find in Neo when he first comes to her. She says that being the One is like being in love, you just know it in your core if it is true. Neo is like a blank slate when he comes to the Oracle. He knows nothing, and he believes in nothing. Perhaps this is what the Oracle wanted to verify in him. It is easier to teach somebody if they don’t have to unlearn somethings first. Having found him amenable to change, Oracle rightly judges him to be an upright and honest person (as he spoke truthfully about his ignorance). Every Matrix iteration has had the One, but when the time comes, the One has always chosen to reboot the Matrix against the destruction of Zion—until Neo. I think this crucial difference in Neo’s decision is what Oracle primed him for by the ‘cookie’.
The decision about saving Zion against rebooting the Matrix was taken by Neo because of a few factors. The first was obviously his love for Trinity. The second was his belief in his own abilities as the ‘One’. All previous versions of the ‘One’ also had love interests but chose to reboot the Matrix. Why did Neo choose the other course?
Free will draws its strength from belief. The depth of his conviction would drive a person’s will to achieve what he believes. So it was important to strengthen Neo’s belief as he had ‘absolute free will’ in the Matrix.
In essence, the cookie was perhaps Oracle’s pill to strengthen his belief system, so that when he would eventually realize that he is the One, his self-belief would be much stronger than his previous iterations. Also perhaps the cookie was also a way to internalize in Neo that ‘being the One is like being in love’ because that is what makes the crucial difference in the end.
1 [Transcript - Matrix Fans]