PHP Classes
Icontem

Class: Session Handler


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend!
      Classes of Scott Christensen  >  Session Handler  >  Download  >  Support forum Support forum  >  RSS 1.0 feed RSS 2.0 feed Latest changes  >  Stumble It! Stumble It!  >  Bookmark in del.icio.us Bookmark in del.icio.us  
  Supplied by   Group folder image Groups   Detailed description  
  Rate classes User ratings   Applications   Related links   Files Files  
  • Supplied by:

    Picture of Scott Christensen
    Name: Scott Christensen <e-mail contact>
    Published packages: 4
    Country: United States United States - PHP jobs in United States
    Home page: http://www.godsarmor.com/
    Age: 36
    All time rank: 123
    Week rank: 442

    Browse this author's classes

  • Groups:

    Group folder image User Management User records, authentication and session handling View top rated classes
  • Detailed description:

    This class implements a session but does not use MySQL as its storage mechanism like other session handling classes do. Instead it uses a directory structure where the session is identified as a directory and keys are files inside of that directory. Each file contains the value assoiciated with the key identified by the file name.

    This session handler requires the use of non-persistent cookies which means it will create cookies on the user's machine, but the cookies will be destroyed when the user closes their browser. This could be an issue because there are those people who have cookies turned off. If you use this class, you may want to detect whether the user has cookies enabled or disabled first. Then use the getURLSessionString function and place what is returned into your URL query string if cookies are turned off.

    I have added a global variable outside of this class that creates a new instance of the session class. This was an attempt to make the session handling "hidden". Instead of creating an instance of this class, you can use the global $SESSION variable.

    Note that this class is not necessary if you are using PHP4 because there is already session handling incorporated into PHP4. See the session handling section on http://www.php.net but you can certainly use it if you would like.

    This class requires an ini file reader that can be found on http://phpclasses.upperdesign.com. It also requires some utility functions that I have written and is another file in this class.

    Usage of this class is pretty simple. Since the global $SESSION object is created for you, there is no reason to create another instance of the object. Use $SESSION->register to register a key/value pair with the session handler for the correct session. Use $SESSION->retrieve to retrieve a value from the session for a given key. If you need to get rid of everything in the session, call $SESSION->destroy which deletes the existing session and creates a new one. If you want to only delete a key from the existing session, call the $SESSION->deleteKey function.
  • User ratings:

    Ratings
    Utility
    Consistency
    Documentation
    Examples
    Tests
    Videos
    Overall
    Rank
    All time:
    Good (85.0%)
    Good (95.0%)
    -
    -
    -
    -
    Not sure (52.0%)
    1037
    Month:
    Not yet rated by the users
  • Applications that use this class:

    No application links were specified for this class.
    Add link image If you know an application of this package, send a message to the author to add a link here.
  • Related links:

    Link Description
    cIniFileReader.inc ini file reader class required for the session handler to work
  • Files:

    File Role Description
    Plain text file cSession.inc Class Session handler class
    Plain text file hSession.inc Aux. header file for session class
    Plain text file hUtility.inc Aux. header file for utility functions
    Plain text file mUtility.inc Aux. utility functions for session handler
    Plain text file Session.ini Data ini file for session class
    Plain text file TestSession.php3 Example test script for session handler
    Download all files: session.tar.gz session.zip
    NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2008 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products