News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Baking Cookies in PHP
July 26, 2012 @ 08:07:09

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.

0 comments voice your opinion now!
cookie tutorial introduction setcookie


blog comments powered by Disqus

Similar Posts

PHP Freaks: Design Patterns - Introduction

Raphael Stolt's Blog: Logging to MongoDb and accessing log collections with Zend_Tool

PHP-Tools Blog: Der Zauberlehrling - Sorcerer's Apprentice

Gonzalo Ayuso: Dependency Injection Containers with PHP. When Pimple is not enough.

DevShed: PHP Closures as View Helpers: Lazy-Loading File Data


Community Events





Don't see your event here?
Let us know!


security composer library update voicesoftheelephpant tool interview version podcast opinion series language application package introduction release symfony laravel community framework

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework