PHP 클래스 yii\web\CacheSession
The cache being used can be any cache application component.
The ID of the cache application component is specified via [[cache]], which defaults to 'cache'.
Beware, by definition cache storage are volatile, which means the data stored on them
may be swapped out and get lost. Therefore, you must make sure the cache used by this component
is NOT volatile. If you want to use database as storage medium,
DbSession is a better choice.
The following example shows how you can configure the application to use CacheSession:
Add the following to your application config under
components:
php
'session' => [
'class' => 'yii\web\CacheSession',
'cache' => 'mycache',
]
파일 보기
프로젝트 열기: yiisoft/yii2
1 사용 예제들
공개 프로퍼티들
프로퍼티 |
타입 |
설명 |
|
$cache |
|
the cache object or the application component ID of the cache object.
The session data will be stored using this cache object.
After the CacheSession object is created, if you want to change this property,
you should only assign it with a cache object.
Starting from version 2.0.2, this can also be a configuration array for creating the object. |
|
공개 메소드들
보호된 메소드들
메소드 상세
Generates a unique key used for storing session data in cache.
Do not call this method directly.
getUseCustomStorage()
공개 메소드
This method overrides the parent implementation and always returns true.
Initializes the application component.
Do not call this method directly.
Do not call this method directly.
프로퍼티 상세
the cache object or the application component ID of the cache object.
The session data will be stored using this cache object.
After the CacheSession object is created, if you want to change this property,
you should only assign it with a cache object.
Starting from version 2.0.2, this can also be a configuration array for creating the object.