web\DbSession $sessionTable

$sessionTable public property

The name of the DB table that stores the session data. The table should be pre-created as follows:

CREATE TABLE session
(
    id CHAR(40) NOT NULL PRIMARY KEY,
    expire INTEGER,
    data BLOB
)

where 'BLOB' refers to the BLOB-type of your preferred DBMS. Below are the BLOB type that can be used for some popular DBMS:

  • MySQL: LONGBLOB
  • PostgreSQL: BYTEA
  • MSSQL: BLOB

When using DbSession in a production server, we recommend you create a DB index for the 'expire' column in the session table to improve the performance.

Note that according to the php.ini setting of session.hash_function, you may need to adjust the length of the id column. For example, if session.hash_function=sha256, you should use length 64 instead of 40.

public string $sessionTable = '{{%session}}'
doc_Yii
2016-10-30 17:14:54
Comments
Leave a Comment

Please login to continue.