PHP Class Prado\Web\TCacheHttpSession

TCacheHttpSession provides access for storing session data using a cache module (e.g. TMemCache, TDbCache). To specify the cache module for data storage, set the {@link setCacheModuleID CacheModuleID} property which should refer to a valid cache module configured in the application configuration. The following example shows how we configure TCacheHttpSession: Beware, by definition cache storage are volatile, which means the data stored on them may be swapped out and get lost. This may not be the case for certain cache storage, such as database. So make sure you manage your cache properly to avoid loss of session data.
Since: 3.1.1
Author: Carl G. Mathisen ([email protected])
Author: Qiang Xue ([email protected])
Inheritance: extends THttpSession
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Méthodes publiques

Méthode Description
_destroy ( $id ) : boolean Session destroy handler.
_read ( $id ) : string Session read handler.
_write ( $id, $data ) : boolean Session write handler.
getCache ( ) : Prado\Caching\ICache
getCacheModuleID ( ) : string
getKeyPrefix ( ) : string
init ( $config ) Initializes the module.
setCacheModuleID ( $value )
setKeyPrefix ( $value )

Méthodes protégées

Méthode Description
calculateKey ( $id ) : string

Method Details

_destroy() public méthode

This method should be overriden if {@link setUseCustomStorage UseCustomStorage} is set true.
public _destroy ( $id ) : boolean
Résultat boolean whether session is destroyed successfully

_read() public méthode

Session read handler.
public _read ( $id ) : string
Résultat string the session data

_write() public méthode

Session write handler.
public _write ( $id, $data ) : boolean
Résultat boolean whether session write is successful

calculateKey() protected méthode

protected calculateKey ( $id ) : string
Résultat string a safe cache key associated with the session variable name

getCache() public méthode

public getCache ( ) : Prado\Caching\ICache
Résultat Prado\Caching\ICache the cache module being used for data storage

getCacheModuleID() public méthode

public getCacheModuleID ( ) : string
Résultat string the ID of the cache module.

getKeyPrefix() public méthode

public getKeyPrefix ( ) : string
Résultat string prefix of session variable name to avoid conflict with other cache data. Defaults to 'session'.

init() public méthode

This method is required by IModule. It reads the CacheModule property.
public init ( $config )

setCacheModuleID() public méthode

public setCacheModuleID ( $value )

setKeyPrefix() public méthode

public setKeyPrefix ( $value )