moved all cookie stuff to its own document