Detect if there's a userinfo section in the window href, and if there is, try to set up the ram auth cookie correctly so that we immediately auth straight through.
Remember how stupid JS is...
Simplify and abstract a bit.
Hide "log out" button if it's not going to do anything.
Merge bug25811