How to Create Login and Logout Page with Session and Cookies in PHP

In my previous tutorial, I've shown you How to Set up Cookie. This tutorial will give you an idea of how to use the stored cookie to login and I've added a "logout" function that destroys both session and cookie. Creating our Database First, we're going to create a database that contains our data. Open phpMyAdmin. Click databases, create a database and name it as "cookie". After creating a

Setting up Cookie upon Login using PHP/MySQLi

In my previous post, I created a Simple Login with Validation, so I've decided to create another tutorial to show how to set up cookie upon user login. But in this tutorial, I have created a simple login since the focus of this tutorial is to give you knowledge on how to set up cookie. Cookies are small amount of data that has been stored in user's computer. This is used so that when the same

Using Cookies in PHP

This is a very simple and basic tutorial in PHP. This will teach you how to use and set cookie in PHP. Cookies allows the webmaster to store user's or visitor's information to be accessed on the next visit in the website. It is usually used in logging in, to store the username and password. But note, don't use cookie on an important information. Here is the code to set the cookie: $cookie_name =