MySQL
  Home arrow MySQL arrow Developing Custom PHP Sessions
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
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? 
MYSQL

Developing Custom PHP Sessions
By: Brian Rosner
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 21
    2002-07-21

    Table of Contents:
  • Developing Custom PHP Sessions
  • Developing the Backend
  • Creating the Session Functions (contd.)
  • Using Our Sessions
  • Conclusion

  • 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


    Developing Custom PHP Sessions


    (Page 1 of 5 )

    Ever wondered how to make your own session handling functions with PHP? In this article Brian shows us how to do just that using PHP, MySQL and a bit of maths!If you were programming a user authorization system for your website, then you would use a session or a cookie to pass data. A session would store the data on the server and reference it by a unique key or ID. As your members browse through the member pages, his/her data could be displayed or used by fetching that data. Alternatively, you could use a cookie that stores the data on the users’ computer. Fetching the data from the cookie would be similar to a session except you use the cookie name: PHP handles the actual retrieval and sorting of the cookie data.

    PHP's session handling functions are OK, but what if you wanted to create your own sessions? In this article I will teach you how to create and maintain your own customized sessions. You will have complete control over how your session handles the data and how it fetches the data to make it available in your scripts.

    This is very useful because you can track users' IP addresses and other information you can grab with PHP. There are many more advantages to creating your own sessions as compared to using PHP's built-in session handing functions.

    In this tutorial I will assume the following things:
    • You have PHP4+ and MySQL installed on your server.
    • You have strong PHP and MySQL skills.
    • You know object-oriented programming for PHP.
    Anyhow, let's get started and work those customized PHP sessions!

    More MySQL Articles
    More By Brian Rosner


     

    MYSQL ARTICLES

    - MySQL and BLOBs
    - Two Lessons in ASP and MySQL
    - Lord Of The Strings Part 2
    - Lord Of The Strings Part 1
    - Importing Data into MySQL with Navicat
    - Building a Sustainable Web Site
    - Creating An Online Photo Album with PHP and ...
    - Creating An Online Photo Album with PHP and ...
    - PhpED 3.2 – More Features Than You Can Poke ...
    - Creating An Online Photo Album with PHP and ...
    - Creating An Online Photo Album with PHP and ...
    - Security and Sessions in PHP
    - Setup Your Personal Reminder System Using PHP
    - Create a IP-Country Database Using PERL and ...
    - Developing a Dynamic Document Search in PHP ...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway