more cookie stuff and logging