Hello everyone, we're still working on the php course.
In this video, I'll talk about cookies
and sessions because https state else means that the stored data is erased when the page
is sent to the client and the connection is closed. After a while, Netscape added a feature
known as cookies to their browser. A cookie is a plain text file without any formatting or
decoration that is created by the user's browser on their own computer. Each cookie can
only be read by the website that created it. Cookies gained a bad reputation at first because
of the problem of storing sensitive information on computers.
If you want to be more specific, cookies were labeled as the end of privacy on the internet,
with many sites claiming that cookies could read information from your hard drive, and
people began to disable cookies.
To solve this problem, another solution was devised: sessions. Sesiones grew out of cookies
as a way of storing data on a server a unique user identification number This identifier is
sent to the user automatically via cookies.
During this session, you can save the values of the variables and access them from any of
the pages where you start a session.
An added benefit is that changing the value of the variables automatically changes its value
for the session. In a cookie, you can save very little data up to a maximum of four hundred
and thirty characters, and you can only store up to twenty cookies per domain. It's necessary
to have it present because we use cookies in different parts of our sit. On the other hand, a
browser can only store up to 300 cookies in total that are shared across all of the websites
that the user visits. This is an important point to remember since storing the user's name and
password directly in a cookie is not a good practice because it creates a security risk.