Prevent a possible cookie array mutation-while-enumeration error