Your code snippet is not redefining any functions. It is essentially “extending” the assignment capabilities of Common Lisp — one of the nice features of the language. If someone attempts to (setf (cookies-out* ...) ...), then your latter snippet of code will be used to perform that assignment.
A commenter on your question has already mentioned these “setf expanders,” and to elaborate on this, you may find it useful to read the following items from the CLHS. Note that your example uses the (defun (setf ...) ...) form, and so the first two links apply.
DEFUN allows you define a function that will be run for a SETF.
DEFSETF allows you to name a function (in the short form) to do the job, or define a macro (in the long form) that will be expanded for a SETF, and you usually have to be careful to use PROGN appropriately for the latter case.
DEFINE-SETF-EXPANDER is used where DEFSETF’s long form is not sufficient, although I have never had cause to use it. See this comp.lang.lisp thread for some useful information on that: https://groups.google.com/forum/#!searchin/comp.lang.lisp/difference$20between$20defsetf$20defun$20setf/comp.lang.lisp/5x3fjzMQ6Q0/_y8Q-P-SVPQJ
It has been my personal experience that the need to write my own SETF expanders is rare, given that I write more and more of my code in a “functional” style. That said, when reaching into complex structures to make modifications, it can often prove to be a very handy technique… at least until I understand whether functional lenses are a feasible/desirable alternative.