By default, DbSession stores session data in a DB table named 'session'. This table
must be pre-created. The table name can be changed by setting [[sessionTable]].
The following example shows how you can configure the application to use DbSession:
Add the following to your application config under components:
php
'session' => [
'class' => 'yii\web\DbSession',
'db' => 'mydb',
'sessionTable' => 'my_session',
]
DbSession extends MultiFieldSession, thus it allows saving extra fields into the [[sessionTable]].
Refer to MultiFieldSession for more details.