setting cookies properly