Reduce number of calls to authenticated_userid in home page

Please review.