Top 3 Products & Services
Dated: Sep. 19, 2005
Related CategoriesPHP Programming
Building web applications with membership management is one of the most frequent tasks that every programmer does. Managing membership data, such as username, password and the member's profile with sessions in PHP is the easiest and simplest solution.
Sessions stores data about a particular user that you need on all of the pages in a variable and access it from any page. Using sessions you could hold data about particular user and access that info on all the pages as long as the user is active on the site.
Each session holds different values for different user. Sessions automatically die when the user's session is over or he closes his browser.
PHP's session-handling features, was first introduced in the 4.0 release. Sessions are native and thus require no additional packages.
To work with Sessions we will be using
session_register() functions, its important that you add sesions_start to every page where you would like to use sessions.
Okay now we have created a session with name
color and assigned it as blue, now in our second program
(session2.php) we access the value of our session
To delete a session variable we use the function
session_unregister() so to delete our session
color we would use the code.
Now that you've gotten free know-how on this topic, try to grow your skills even faster with online video training. Then finally, put these skills to the test and make a name for yourself by offering these skills to others by becoming a freelancer. There are literally 2000+ new projects that are posted every single freakin' day, no lie!