Cookies have long been used in PHP scripts, and are a very useful function. But what exactly are cookies? Maybe you have used then, but you still don't know exactly what they are. Or you are completely new to cookies? It doesn't matter, because in this tutorial I will show you exactly what cookies are, and what they are used for.
A cookie is a small bit of inforation stored on a viewer's computer by his or her web browser by request from a web page. The information is constantly passed in HTTP headers between the browser and web server; the browser sends the current cookie as part of its request to the server and the server sends updates to the data back to the user as part of its response.
Sometimes it becomes necessary to track certain user details like (No. Of Visits, names, last visit, etc). The client machine stores such information and sends it to the web server whenever there is a request. Cookies data are sent along with the HTTP headers.
A cookie is a block of information generated by the web server and stored on the client machine. Cookie data gets sent along with the rest of the HTTP headers. Like other headers, cookies must be sent before any output from your script (this is a protocol restriction for headers). If output exists prior to calling this function, creation of the cookie will fail and return FALSE.
This tutorial assumes several things about the reader:
You are familiar with PHP
You have access to a server or servers running the PHP package
We will first cover the basics of cookies then move onto some practical implementations of cookies.
Tutorial kommentieren Defekten Link melden
Jesus schreibt:
Rülps!°
Cookies can be very useful tiny files that can help tracks users, show targetted advertising, and much more. PHP prodives and simple, easy-to-use function that makes it easy for all this to be accomplished.
This article explains the usage of cookies in PHP.
Tutorial kommentieren Defekten Link melden
CuSToMMadE schreibt:
Broken Link
Das Tutorial zeigt, wie man Cookies auch über mehrere Domains hinweg implementieren kann.








