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

Class: HTTP_Session_Container_MDB2

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

Class Overview

HTTP_Session_Container
   |
   --HTTP_Session_Container_MDB2

Database container for session data


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 The PHP Group

Methods


Inherited Variables

Inherited Methods

Class: HTTP_Session_Container

HTTP_Session_Container::HTTP_Session_Container()
Constrtuctor method
HTTP_Session_Container::close()
This function is called when the page is finished executing and the session handler needs to close things off
HTTP_Session_Container::destroy()
This function is called when a session is destroyed.
HTTP_Session_Container::gc()
This function is responsible for garbage collection.
HTTP_Session_Container::open()
This function is called by the session handler to initialize things
HTTP_Session_Container::read()
This function is called by the session handler to read the data associated with a given session ID.
HTTP_Session_Container::replicate()
This function copies session data of specified id to specified table
HTTP_Session_Container::set()
Set session save handler
HTTP_Session_Container::write()
This function is called when the session handler has session data to save, which usually happens at the end of your script

Class Details

[line 60]
Database container for session data

Create the following table to store session data

  1.  CREATE TABLE `sessiondata` (
  2.      `id` CHAR(32NOT NULL,
  3.      `expiry` INT UNSIGNED NOT NULL DEFAULT 0,
  4.      `data` TEXT NOT NULL,
  5.      PRIMARY KEY (`id`)
  6.  );



[ Top ]


Method Detail

HTTP_Session_Container_MDB2 (Constructor)   [line 95]

void HTTP_Session_Container_MDB2( array $options)

Constructor method

$options is an array with the options.
The options are:

  • 'dsn' - The DSN string
  • 'table' - Table with session data, default is 'sessiondata'
  • 'autooptimize' - Boolean, 'true' to optimize the table on garbage collection, default is 'false'.

  • Access: public

Parameters:

array   $options   —  Options

[ Top ]

close   [line 174]

bool close( )

Free resources

Overrides HTTP_Session_Container::close() (This function is called when the page is finished executing and the session handler needs to close things off)
[ Top ]

destroy   [line 260]

bool destroy( string $id)

Destroy session data

Overrides HTTP_Session_Container::destroy() (This function is called when a session is destroyed.)

Parameters:

string   $id   —  Session id

[ Top ]

gc   [line 330]

bool gc( int $maxlifetime)

Garbage collection

Overrides HTTP_Session_Container::gc() (This function is responsible for garbage collection.)

Parameters:

int   $maxlifetime   —  Maximum lifetime

[ Top ]

open   [line 160]

bool open( string $save_path, string $session_name)

Establish connection to a database

Overrides HTTP_Session_Container::open() (This function is called by the session handler to initialize things)

Parameters:

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

[ Top ]

read   [line 186]

mixed read( string $id)

Read session data

Overrides HTTP_Session_Container::read() (This function is called by the session handler to read the data associated with a given session ID.)

Parameters:

string   $id   —  Session id

[ Top ]

write   [line 209]

bool write( string $id, mixed $data)

Write session data

Overrides HTTP_Session_Container::write() (This function is called when the session handler has session data to save, which usually happens at the end of your script)

Parameters:

string   $id   —  Session id
mixed   $data   —  Data

[ Top ]


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