cookies handling prototype