Presist login state

@adamdahan test on this branch before merge.