Home arrow PHP arrow Using Session Handling Objects to Maintain the State of Applications with PHP Sessions

Using Session Handling Objects to Maintain the State of Applications with PHP Sessions

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.

TABLE OF CONTENTS:
  1. Using Session Handling Objects to Maintain the State of Applications with PHP Sessions
  2. A procedural implementation of the “session_set_save_handler()” function
  3. Developing an object-oriented session management module
  4. Coding the session handling class
By: Alejandro Gervasio
Rating: starstarstarstarstar / 27
May 10, 2006

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: