There are 3 users logged in, and each one has their own profile page. How can I restrict others from accessing other profile pages by url?
Before outputting the contents of the profile page, check if the id of the currently logged in user is the same as the id of the owner of the page.
If it does not match show a "permission denied" page instead of the profile.