updated login to work and get cookies