Finished login (except for the cookies part).
Also changed a couple things in the web part.