TITAN Library for PHP5  5.1.0
Web Software Development Kit for PHP5
session Class Reference

Titan Session Class. More...

Inheritance diagram for session:
iterator callback

Public Member Functions

 __construct ($process_id= '', $session_id= '', $load_session=false, $expires_in= '+1 day')
 
 cookie ($name, $ttl= '+1 day')
 
 set ($name, $value= '', $save_session=false)
 
 get ($name, $value= '')
 
 load ()
 
 delete ()
 
 save ()
 
- Public Member Functions inherited from iterator
 max_count ($max_count=-1)
 
- Public Member Functions inherited from callback
 __construct ($callback=NULL)
 
 callback ($callback=NULL)
 
 argument ($value)
 
 parameter ($name, $value= '')
 
factory (array $arguments=array())
 
execute ()
 

Data Fields

 $cooke_name = false
 Cookie name to set for session_id, or false to skip.
 
 $cooke_ttl = '+1 day'
 Cookie Time-To-Live.
 
 $http_host = ''
 Fields http_host, process_id and session_id form a three-part key to identify a unique session record.
 
 $process_id = ''
 See http_host.
 
 $session_id = ''
 See http_host.
 
 $access_time = ''
 Current server time just after reads and just before writes.
 
 $expire_time = ''
 When does the session expire, relative to it's access_time.
 
 $expires_in = '+1 day'
 When does the session expire, relative to it's access_time.
 
 $data = ''
 Serialized data.
 

Protected Attributes

 $timestamp = false
 timestamp object
 
 $database = false
 mysqli object
 
 $table = 'data_session'
 table name
 

Additional Inherited Members

- Protected Member Functions inherited from callback
arguments (array $arguments=array())
 

Detailed Description

Titan Session Class.

Class: \tl\data\session

Author
James E. Bush work@.nosp@m.bush.nosp@m..cc
Version
5.1.0

Table data_session:

  DROP TABLE IF EXISTS `data_session`;
  CREATE TABLE IF NOT EXISTS `data_session` (
    `idx` int(11) NOT NULL AUTO_INCREMENT,
    `http_host` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
    `process_id` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
    `session_id` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
    `access_time` varchar(14) COLLATE utf8_unicode_ci NOT NULL,
    `expire_time` varchar(14) COLLATE utf8_unicode_ci NOT NULL,
    `expires_in` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
    `data` text COLLATE utf8_unicode_ci NOT NULL,
    PRIMARY KEY (`idx`),
    UNIQUE KEY `session_id` (`http_host`,`process_id`,`session_id`),
    KEY `expire_time` (`expire_time`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Constructor & Destructor Documentation

__construct (   $process_id = '',
  $session_id = '',
  $load_session = false,
  $expires_in = '+1 day' 
)

Constructor

Parameters
string$process_id(optional) Process or program ID (default) $_SERVER['SCRIPT_NAME']
string$session_id(optional) Session ID (default) $_SERVER['REMOTE_ADDR']
boolean$load_session(optional) Should we load the session? (default) false
string$expires_in(optional) How long before the session expires? (default) '+1 day'
Returns
session Session handling object

Member Function Documentation

cookie (   $name,
  $ttl = '+1 day' 
)

Sets cookie for session_id

Parameters
string$nameThe name of the cookie
string$ttl(optional) Cookie Time-To-Live (default) '+1 day'
set (   $name,
  $value = '',
  $save_session = false 
)

Set the value of a session variable

Parameters
string$nameThe name of the session variable to set
mixed$value(optional) The new value for the session variable (default) '', erase the session variable
boolean$save_session(optional) Should we save the session after setting this variable? (default) false
Returns
mixed The value of the session variable
get (   $name,
  $value = '' 
)

Get the value of a session variable

Parameters
string$nameThe name of the session variable to retrieve
mixed$value(optional) Default value if not already set (default) ''
Returns
mixed The value of the session variable
load ( )

Load the session data

delete ( )

Delete the data

save ( )

Save the data


The documentation for this class was generated from the following file: