Cookies are used to remember certain things from one execution of a page to another. What they do is allow you to write on the users disc certain things that may be recalled by your code at a later execution of your page. Things such as how many times have they been on your page, how many times have they ordered things from your site, do they have something like a discount coupon active because of their past ordering activity - all sorts of stuff that is only limited by your imagination. 400 char max per cookie.
This example gives you a way to use cookies on the users machine. BEWARE - some users do not like cookies being stored on their computers and they can deactivate the ability to store them, or delete them at will. If they accept PayPal then they must accept cookies, and in that case you should respect their systems and not use cookies in a bothersome way. If you don't have a specific reason for using them, THEN DON'T!
What can you do with the information stored in cookies?
On the client-side this ability is somewhat limited, and you MUST take special care to assure that your reading and update of things such as "times accessed" is an accurate reflection of what really happens. A user can navigate about a site and cause the load of a home-page, for example, more than once during his visit.
To this end, you should ensure that certain updates of data within the cookie are only allowed in pages such as pointed to by the "return" variable within the PayPal cart data, and other variables are only changed if the user vectors with the "cancel_return" back into your site. It is all up to YOU - I just show you how...