PHP
  Home arrow PHP arrow Using Session Handling Objects to Maintain the State of Applications with PHP Sessions
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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

Using Session Handling Objects to Maintain the State of Applications with PHP Sessions
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 25
    2006-05-10


    Table of Contents:
  • Using Session Handling Objects to Maintain the State of Applications with PHP Sessions
  • A procedural implementation of the “session_set_save_handler()” function
  • Developing an object-oriented session management module
  • Coding the session handling class

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    Using Session Handling Objects to Maintain the State of Applications with PHP Sessions
    ( Page 1 of 4 )

    Here you have it. The tutorial that you were waiting for! Welcome to the concluding part of the series “Maintaining the state of applications with PHP sessions.” In several tutorials, this series goes through the key points of managing sessions in PHP, and explores some of their most advanced features, such as developing user-defined session storage modules and using session handling objects.

    Introduction

    If you’ve already read my two previous tutorials in this series, then probably you’ve expanded your knowledge of the basics of PHP session management, including the proper understanding of some of the core operations required for creating, using and destroying sessions.

    In addition, handling and propagating session IDs should be pretty familiar concepts to you, since I covered this topic in detail in the first tutorial. However, in order to get the most out of the PHP session management module, during the second article you learned how to build a custom session mechanism by utilizing the helpful “session_save_path()” and “session_set_save_handler()” functions. Specifically, the last function allows you to build an entirely customized session module. This module can potentially use MySQL (or other RDBMS) for saving session-related data, in this way increasing the security of the overall session handling mechanism.

    Well, if sessions were a foreign concept to you before reading these tutorials, now you have enough source code to experiment with yourself and start including advanced session scripts within your PHP applications. Nevertheless, the subject is certainly huge and deserves an in-depth look, particularly in those topics related to advanced session handling.

    Keeping this idea in mind, in this last part of the series, I’ll explain how to use the PHP built-in “session_set_save_handler()” function inside of a PHP class, in order to create highly-centralized session handling objects. Are you ready to learn how this will be done? Right, let’s go!



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Using Directory Iterators to Build Loader Ap...
    - Using the spl_autoload() Functions to Build ...
    - Working Out of the Object Context to Build L...
    - Using the _autoload() Magic Function to Buil...
    - The Destruct Magic Function in PHP 5
    - The Autoload Magic Function in PHP 5
    - Developing a Recursive Loading Class for Loa...
    - The Sleep and Wakeup Magic Functions in PHP 5
    - Using the Clone Magic Function in PHP 5
    - Including Files Recursively with Loader Appl...
    - The Call Magic Function in PHP 5
    - Designing a Captcha System with PHP and MySQL
    - Using Static Methods to Build Loader Apps in...
    - The Isset and Unset Magic Functions in PHP 5
    - Advanced PHP Form Input Validation to Check ...





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