Util/SessionHandler.php
- Classes
- Kwf_Util_SessionHandler
\Kwf_Util_SessionHandler
- see
- http://pureform.wordpress.com/2009/04/08/memcache-mysql-php-session-handler/
 Properties Properties
- $_lifeTime
- $_refreshTime
 Methods Methods
- close
- destroy
- gc
- init
- open
- read
- write
Description
Memcache & MySQL PHP Session Handler
original author Jakub Matějka jakub@keboola.com
Properties
$_lifeTime
int $_lifeTime = ''
 Details
 Details
- int
 
- visibility
- protected
- default
- final
- false
- static
- false
$_refreshTime
int $_refreshTime = ''interval for session expiration update in the DB
 Details
 Details
- int
 
- visibility
- protected
- default
- final
- false
- static
- false
Methods
close
close(
          
          )
        
        :
        boolclosing the session
Output
- bool
 Details
 Details
- visibility
- public
- final
- false
- static
- false
destroy
destroy(
          string $sessionId
          )
        
        :
        booldestroy of the session
Arguments
- $sessionId
- string
 
Output
- bool
 Details
 Details
- visibility
- public
- final
- false
- static
- false
gc
gc(
          int $maxlifetime
          )
        
        :
        boolcalled by the garbage collector
Arguments
- $maxlifetime
- int
 
Output
- bool
 Details
 Details
- visibility
- public
- final
- false
- static
- false
init
init(
          
          )
        
        :
        
 Details
 Details
- visibility
- public
- final
- false
- static
- true
open
open(
          string $savePath, string $sessionName
          )
        
        :
        boolopening of the session - mandatory arguments won't be needed
Arguments
- $savePath
- string
 
- $sessionName
- string
 
Output
- bool
 Details
 Details
- visibility
- public
- final
- false
- static
- false
read
read(
          string $sessionId
          )
        
        :
        stringreading of the session data if the data couldn't be found in the Memcache, we try to load it from the DB we have to update the time of data expiration in the db using _updateDbExpiration() the life time in Memcache is updated automatically by write operation
Arguments
- $sessionId
- string
 
Output
- string
 Details
 Details
- visibility
- public
- final
- false
- static
- false
write
write(
          string $sessionId, string $data
          )
        
        :
        boolcache write - this is called when the script is about to finish, or when session_write_close() is called data are written only when something has changed
Arguments
- $sessionId
- string
 
- $data
- string
 
Output
- bool
 Details
 Details
- visibility
- public
- final
- false
- static
- false