A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values. A cookie is created with the setcookie() function.
how to make a Real-time chat application using PHP, AJAX & MYSQL
Give me some codes :) or some link ;)
For detailed information, you can walk through this video:
Here is the source code of Chat Application by another YouTube Creator.
Here is an explanation of the source code— https://youtu.be/XkV9XdHueL8