cookie setup and login preperation