Guys, I hope you have learned something new in this video. 5. This system is composed of three different parts: A Database where to store the accounts information. Create a PHP script for login. Here, we do a couple things. the Script executes after submitting the user login button. Session in PHP example for login and logout I am going to create one HTML Login form with email and password fields. I try my best to explain every thing in this article. If any user wants to access any page session return to the login page. This tutorial is comprised of two parts: in the first part we'll create a user registration form, and in the second part we'll create a login form, as well as a welcome … Some Bootstrap components. For this tutorial I will be passing the Session class and instance of the Database class that I wrote about in Roll your own PDO PHP Class . PHP Login and Registration script includes HTML Forms, PHP Session code & interacts with MySQL database to access users data. Let's create a database table using the MYSQL query.