How can I store Craft sessions in the database?
To store sessions in the DB in Craft 3, you can merge the following into your config/app.php file:

return [
    'components' =&gt; [
        'session' =&gt; [
            'class' =&gt; yii\web\DbSession::class,
            'as session' =&gt; craft\behaviors\SessionBehavior::class
        ],
    ],
];


Then you need to manually create a session table in your database. Here's a mysql migration:

CREATE TABLE session
(
    id VARCHAR(255) NOT NULL PRIMARY KEY,
    uid VARCHAR(255) NOT NULL UNIQUE,
    expire INTEGER,
    data BLOB,
    dateCreated TIMESTAMP NOT NULL,
    dateUpdated TIMESTAMP NOT NULL
)


I wrote the Craft 2 DB sessions plugin referenced in the question. The Craft 3 approach is much nicer.