O'Reilly logo

PHP Application Development with NetBeans Beginner's Guide by M A Hossain Tonu

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

Time for action — creating the UserService class

We will use My\Service as the namespace for this class, and keep any constants in the class. The UserService class attributes will contain the user information, such as the user e-mail, user ID, username, or phone, and the constructor checks for logged in user and class variables loaded with the user details from the session. Also, the class will make use of PHP cookies to store the user's login data. The class will act as the login session manager. So initially, the class will check for the login data in sessions or in cookies that the user is logged into.

Tip

It is recommended that you are familiar with PHP sessions and cookies for this tutorial.

So let's go through the following steps, in order ...

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