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
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
_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 )