moved cookie stuff to view