It depends on the kind of authentication you are using. If you are checking database then add all user details in your database. If you are windows authentication then add all users in your active directory.
Gmail/Yahoo will be using athentication for each page otherwise you will be able to see some other person mail box and email.
Authentication:- This is the process of verifying the users identity by collecting information from users.
Autherisation:- This is the process of giving permission to the authenticated user.
Asheej T K