O'Reilly logo

PHP 5 Social Networking by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Users

At their core, users can be represented by a few simple pieces of information:

  • A unique identifier such as a user ID
  • A unique identifier that the user themselves can easily remember, such as their chosen username or their e-mail address
  • A password, which is used to authenticate the user—to prove they are who they say they are

As far as our authentication system is concerned, this will be a user. We will of course extend this with a user profile, but in terms of authentication, this is all the information we need.

Our user object

Our user object is created when a user tries to log in, either based on submitting a login form supplying their username and password, or based on session data for the user ID.

If username and password are supplied, then ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required