Skip to content

Commit

Permalink
Merge pull request #44 from imarc/db-sessions-app-web
Browse files Browse the repository at this point in the history
Move DB sessions from app.php to app.web.php config file
  • Loading branch information
khamer authored Aug 29, 2022
2 parents 7f800d7 + 50a2cd3 commit 77679ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
9 changes: 1 addition & 8 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,5 @@
'bootstrap' => [
'site-module',
'volume-permissions',
],
'components' => [
'session' => [
'class' => yii\web\DbSession::class,
'as session' => craft\behaviors\SessionBehavior::class,
'sessionTable' => '{{%phpsessions}}'
],
],
]
];
17 changes: 17 additions & 0 deletions config/app.web.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

return [
'components' => [
'session' => function() {
$config = craft\helpers\App::sessionConfig();

$config['class'] = yii\web\DbSession::class;

$config['as session'] = craft\behaviors\SessionBehavior::class;

$config['sessionTable'] = craft\db\Table::PHPSESSIONS;

return Craft::createObject($config);
},
],
];

0 comments on commit 77679ce

Please sign in to comment.