Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

PHPMaster.com: Baking Cookies in PHP

PHPMaster.com: Baking Cookies in PHP

On PHPMaster.com there’s a new tutorial about working with cookies in PHP applications – an introductory look at what they are, how to set them and how to read their values.

Have you ever wondered that in spite of HTTP being a stateless protocol, when you log in to a website and buy stuff and checkout how the server can identify you uniquely? You might wonder if HTTP is stateless but your state is maintained through your interactions, isn’t this a contradiction? Welcome to world of cookies (not the ones which we can eat, btw :) ), one the of primary ways to maintain user state and interaction between the web browser and the web server.

She shares a lifecycle of a common cookie and describes the parts of the setcookie method (parameters). There’s also a few code examples showing how to read and write to them as well as update their values/expirations.

Source: http://www.phpdeveloper.org/news/18274

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Posted Lipiec 27th, 2012 in WEB and PHP Development.

Leave a response: