Whenever you want to create a website that allows you to store and display information about a user, determine which user groups a person belongs to, utilize permissions on your website or you just want to do something cool on your site, PHP's Sessions are vital to each of these features.
You may be thinking right now, well that's nice, but I can do this with Cookies! This may come to you as a suprise, but Cookies are about 30% unreliable right now and it's getting worse every day. More and more web browsers are starting to come with security and privacy settings and people browsing the net these days are starting to frown upon Cookies because they store information on their local computer that they do not want stored there. PHP has a great set of functions that can achieve the same results of Cookies and more without storing information on the user's computer. PHP Sessions store the information on the web server in a location that you chose in special files. These files are connected to the user's web browser via the server and a special ID called a "Session ID". This is nearly 99% flawless in operation and it is virtually invisible to the user.
Sessions can be used for a wide variety of purposes. On PHP Freaks.com we use them to identify a user, aide in the input of form information and determine user rights on the website. Based upon the information that is extracted about a user during the signup and login process we can do many cool things. If you are logged in as a Member right now, take a look on the left side where it says "Logged in as xxxxx". That's your first name and it's being read directly from your Session. Pretty cool eh? Well, enough babbling, let's show you how to do all of this cool stuff!
This entire tutorial has a complete set of source code scripts you can download on the last page. These source code scripts will have all of the code in this tutorial and will also have an index for you to follow and test out each of the features we have discussed.
Find the entire article Here
_________________
www.easternBrain.com ....The Multitopic Blog: Information, Opinion and Analysis
www.vishnuRao.com .....My Blog #2 on: Cyber Laws, eCommerce and related areas (Running in BETA)
www.vishnuRao.com/blog .... My Personal Blog

