Sets a logged_in variable when a user is logged in.