persist logged in user between page refreshes and clean up server.js