Added login and session preservation, templates can see user data if logged in