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.
Show file
Open project: pradosoft/prado
Class Usage Examples
Public Methods
Protected Methods
Method Details
This method should be overriden if {@link setUseCustomStorage UseCustomStorage} is set true.
calculateKey()
protected method
public getCache ( ) : Prado\Caching\ICache |
return |
Prado\Caching\ICache |
the cache module being used for data storage |
getCacheModuleID()
public method
getKeyPrefix()
public method
public getKeyPrefix ( ) : string |
return |
string |
prefix of session variable name to avoid conflict with other cache data. Defaults to 'session'. |
This method is required by IModule.
It reads the CacheModule property.
setCacheModuleID()
public method
setKeyPrefix()
public method