Now what can I tell you about Cookies and Sessions? Well the great thing is it is not too complicated to understand how they work and how they actually can be a benefit, not only to the web developer but more importantly the client and user.
If you are unfamiliar with what a Cookie is, it is PHP code that preserves some form of state of a webpage or application. Think of it this way; you have logged into to your favorite site and you pay attention to a little welcome blurb at the top of the page by the header and navigation and it says, "Welcome back, Dave." - by the way, you are Dave - Now this makes you wonder, "How the heck did muffler.com know that I left and had returned?" Cookies my friend. Muffler.com has some PHP code embedded, the cookie and as you work on the page, your browser requests a URL from the web server that corresponds to the PHP code. The server then sends the information back to your browser and stores it right there on your computer. Did I lose you? To be less confussing, here is a diagram that helps you see how the cookie makes it to your browser and how it works.
I hope this helps you understand a little bit of what is going on with a cookie.
Now Sessions are pretty much the same idea as a cookie. A difference lies in where your information is stored. With a cookie, information is stored on your browser on your computer. Sessions stores the information on the web server. The reason each were created were due to multiple reasons. One is that some users have cookies disabled in thier computer, which makes shopping and storing items in a shopping cart very difficult if you have to leave and come back later. Another reason is instead of storing lots of information, maybe even sensitive information, sessions will store only cookie that contains a sessions ID on your browser so that PHP can use it to load the stored data on thier server that is associated with that session. Cool eh? So I hope this helps you understand the reasons and methods of how cookies and sessions work.