PHP Класс 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.
С версии: 3.1.1
Автор: Carl G. Mathisen ([email protected])
Автор: Qiang Xue ([email protected])
Наследование: extends THttpSession
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
_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 )

Защищенные методы

Метод Описание
calculateKey ( $id ) : string

Описание методов

_destroy() публичный Метод

This method should be overriden if {@link setUseCustomStorage UseCustomStorage} is set true.
public _destroy ( $id ) : boolean
Результат boolean whether session is destroyed successfully

_read() публичный Метод

Session read handler.
public _read ( $id ) : string
Результат string the session data

_write() публичный Метод

Session write handler.
public _write ( $id, $data ) : boolean
Результат boolean whether session write is successful

calculateKey() защищенный Метод

protected calculateKey ( $id ) : string
Результат string a safe cache key associated with the session variable name

getCache() публичный Метод

public getCache ( ) : Prado\Caching\ICache
Результат Prado\Caching\ICache the cache module being used for data storage

getCacheModuleID() публичный Метод

public getCacheModuleID ( ) : string
Результат string the ID of the cache module.

getKeyPrefix() публичный Метод

public getKeyPrefix ( ) : string
Результат string prefix of session variable name to avoid conflict with other cache data. Defaults to 'session'.

init() публичный Метод

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

setCacheModuleID() публичный Метод

public setCacheModuleID ( $value )

setKeyPrefix() публичный Метод

public setKeyPrefix ( $value )