I would assume its because you have either ', and "'s around the word $cookie. If I recall correctly $variables dont need to be enscupulated by quotes of somekind when referring to them. Try removing them and see what happens.