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.
Показать файл
Открыть проект
Примеры использования класса
Открытые методы
Защищенные методы
Описание методов
_destroy()
публичный Метод
This method should be overriden if {@link setUseCustomStorage UseCustomStorage} is set true.
calculateKey()
защищенный Метод
getCache()
публичный Метод
public getCache ( ) : Prado\Caching\ICache |
Результат |
Prado\Caching\ICache |
the cache module being used for data storage |
getCacheModuleID()
публичный Метод
getKeyPrefix()
публичный Метод
public getKeyPrefix ( ) : string |
Результат |
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()
публичный Метод
setKeyPrefix()
публичный Метод