API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsSessionHandler Class Reference

Public Member Functions

 __construct (XoopsDatabase $db)
 
 open ($savePath, $sessionName)
 
 close ()
 
 read ($sessionId)
 
 write ($sessionId, $data)
 
 destroy ($sessionId)
 
 gc ($expire)
 
 gc_force ()
 
 regenerate_id ($delete_old_session=false)
 
 update_cookie ($sess_id=null, $expire=null)
 

Data Fields

 $db
 
 $securityLevel = 3
 
 $enableRegenerateId = true
 

Protected Attributes

 $bitMasks
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( XoopsDatabase  $db)

Constructor

Parameters
XoopsDatabase$dbreference to the XoopsDatabase object

Member Function Documentation

◆ close()

close ( )

Close a session

Returns
bool
Here is the call graph for this function:

◆ destroy()

destroy (   $sessionId)

Destroy a session

Parameters
string$sessionId
Returns
bool

◆ gc()

gc (   $expire)

Garbage Collector

Parameters
int$expireTime in seconds until a session expires
Returns
bool
Here is the caller graph for this function:

◆ gc_force()

gc_force ( )

Force gc for situations where gc is registered but not executed

Here is the call graph for this function:
Here is the caller graph for this function:

◆ open()

open (   $savePath,
  $sessionName 
)

Open a session

Parameters
string$savePath
string$sessionName
Returns
bool

◆ read()

read (   $sessionId)

Read a session from the database

Parameters
string$sessionIdID of the session
Returns
string Session data
Here is the call graph for this function:

◆ regenerate_id()

regenerate_id (   $delete_old_session = false)

Update the current session id with a newly generated one

To be refactored

Parameters
bool$delete_old_session
Returns
bool
Here is the call graph for this function:

◆ update_cookie()

update_cookie (   $sess_id = null,
  $expire = null 
)

Update cookie status for current session

To be refactored FIXME: how about $xoopsConfig['use_ssl'] is enabled?

Parameters
string$sess_idsession ID
int$expireTime in seconds until a session expires
Returns
bool
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

write (   $sessionId,
  $data 
)

Write a session to the database

Parameters
string$sessionId
string$data
Returns
bool

Field Documentation

◆ $bitMasks

$bitMasks
protected
Initial value:
= array(
2 => array('v4' => 16, 'v6' => 64),
3 => array('v4' => 24, 'v6' => 56),
4 => array('v4' => 32, 'v6' => 128),
)

◆ $db

$db

◆ $enableRegenerateId

$enableRegenerateId = true

◆ $securityLevel

$securityLevel = 3

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