HTTP_Session
[ class tree: HTTP_Session ] [ index: HTTP_Session ] [ all elements ]

Class: HTTP_Session_Container

Source Location: /HTTP_Session-0.5.6/Session/Container.php

Class Overview


Container class for storing session data


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 The PHP Group

Methods


Child classes:

HTTP_Session_Container_MDB2
Database container for session data
HTTP_Session_Container_MDB
Database container for session data
HTTP_Session_Container_DB
Database container for session data
HTTP_Session_Container_Memcache
Database container for session data

Inherited Variables

Inherited Methods


Class Details

[line 45]
Container class for storing session data


[ Top ]


Method Detail

HTTP_Session_Container (Constructor)   [line 63]

object HTTP_Session_Container( [array $options = null])

Constrtuctor method
  • Access: public

Parameters:

array   $options   —  Additional options for the container object

[ Top ]

close   [line 121]

bool close( )

This function is called when the page is finished executing and the session handler needs to close things off

Has to be overwritten by each container class

  • Access: public

Overridden in child classes as:

HTTP_Session_Container_MDB2::close()
Free resources
HTTP_Session_Container_MDB::close()
Free resources
HTTP_Session_Container_DB::close()
Free resources
HTTP_Session_Container_Memcache::close()
Free resources

[ Top ]

destroy   [line 173]

bool destroy( string $id)

This function is called when a session is destroyed.

It is responsible for deleting the session and cleaning things up.

Has to be overwritten by each container class

  • Access: public

Overridden in child classes as:

HTTP_Session_Container_MDB2::destroy()
Destroy session data
HTTP_Session_Container_MDB::destroy()
Destroy session data
HTTP_Session_Container_DB::destroy()
Destroy session data
HTTP_Session_Container_Memcache::destroy()
Destroy session data

Parameters:

string   $id   —  ID of the session

[ Top ]

gc   [line 207]

bool gc( integer $maxlifetime)

This function is responsible for garbage collection.

In the case of session handling, it is responsible for deleting old, stale sessions that are hanging around. The session handler will call this every now and then.

Has to be overwritten by each container class

  • Access: public

Overridden in child classes as:

HTTP_Session_Container_MDB2::gc()
Garbage collection
HTTP_Session_Container_MDB::gc()
Garbage collection
HTTP_Session_Container_DB::gc()
Garbage collection
HTTP_Session_Container_Memcache::gc()
Garbage collection

Parameters:

integer   $maxlifetime   —  Maximum lifetime

[ Top ]

open   [line 107]

bool open( string $save_path, string $session_name)

This function is called by the session handler to initialize things
  • Access: public

Overridden in child classes as:

HTTP_Session_Container_MDB2::open()
Establish connection to a database
HTTP_Session_Container_MDB::open()
Establish connection to a database
HTTP_Session_Container_DB::open()
Establish connection to a database
HTTP_Session_Container_Memcache::open()
Establish connection to a database

Parameters:

string   $save_path   —  Save path
string   $session_name   —  Session name

[ Top ]

read   [line 139]

string read( string $id)

This function is called by the session handler to read the data associated with a given session ID.

This function must retrieve and return the session data for the session identified by $id.

Has to be overwritten by each container class

  • Access: public

Overridden in child classes as:

HTTP_Session_Container_MDB2::read()
Read session data
HTTP_Session_Container_MDB::read()
Read session data
HTTP_Session_Container_DB::read()
Read session data
HTTP_Session_Container_Memcache::read()
Read session data

Parameters:

string   $id   —  ID of the session

[ Top ]

replicate   [line 189]

bool replicate( string $targetTable, [string $id = null])

This function copies session data of specified id to specified table

Has to be overwritten by each container class

  • Access: public

Parameters:

string   $targetTable   —  Table to replicate data to
string   $id   —  ID of the session

[ Top ]

set   [line 218]

void set( )

Set session save handler
  • Access: public

[ Top ]

write   [line 157]

bool write( string $id, mixed $data)

This function is called when the session handler has session data to save, which usually happens at the end of your script

Has to be overwritten by each container class

  • Access: public

Overridden in child classes as:

HTTP_Session_Container_MDB2::write()
Write session data
HTTP_Session_Container_MDB::write()
Write session data
HTTP_Session_Container_DB::write()
Write session data
HTTP_Session_Container_Memcache::write()
Write session data

Parameters:

string   $id   —  ID of the session
mixed   $data   —  The data associated with a given session ID

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:07:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.