PHP
  Home arrow PHP arrow Introduction to Maintaining the State ...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Introduction to Maintaining the State of Applications with PHP Sessions
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 15
    2006-04-26

    Table of Contents:
  • Introduction to Maintaining the State of Applications with PHP Sessions
  • Working with persistent data: the basics of session management
  • Ending a session: using the “session_destroy()” function
  • More session functions ahead: finding out the name of active sessions
  • Configuring the PHP session module: using some helpful session functions

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introduction to Maintaining the State of Applications with PHP Sessions


    (Page 1 of 5 )

    In PHP, session management is used to help web applications maintain their state across several HTTP requests when needed. In this first part of a series, you will learn the basics of the PHP built-in session mechanism, as well as some of its many useful functions.

    Introduction

    Due to the fast evolution of Web programming, the stateless nature of the HTTP protocol brought many problems to certain Web applications that required maintaining their state across several HTTP requests. This demanded a rapid development of several mechanisms aimed at tackling this issue through diverse methods.

    Particularly, in the universe of PHP programming, session management emerged as a direct response to the above mentioned problem, and currently this mechanism is being used by PHP developers worldwide, in cases where a Web application needs to keep track of its “state” during the occurrence of different HTTP requests.

    Whether you’re a beginner developer or an experienced PHP programmer, it’s quite probable you’ve already used some of the built-in functions included within the PHP session management module, when constructing user authentication systems, shopping carts or web-based email applications, to name a few illustrative cases.

    Indeed, PHP sessions are very simple to use. They hide all the complexities inherent to where and how to store session data, and provide developers with a transparent mechanism for managing information that must persist or keep state even if different HTTP requests are triggered across the same Web application.

    Since PHP sessions are one of those things that sooner or later you must learn as a PHP developer, in this article I shall provide an overview of them. I will begin with the basics of how to use them, highlighting their strong points and weaknesses, and finally explore some of their most advanced concepts. By the end of this series, you should have all the knowledge that you need to start using the most common PHP session management functions, so you can use them during the development of your own applications.

    With the preliminaries out of the way, it’s time to move on and start out exploring the features of the session management mechanism in PHP. Let’s get going!

    More PHP Articles
    More By Alejandro Gervasio


       · If you're insterested on learning the basics of PHP sessions along with advanced...
       · this is the nice article to start with sessions i like it very much and waiting for...
       · Thank you for posting your comments regarding this article on PHP sessions. Also,...
       · Well put simple and clear. This article is basic and mostly talks about stuff I knew...
       · Hello Sig,Thank you for commenting on my PHP article. Of course, I'm glad to...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT