Brought over logout/login and stripped out the uneeded info