0

I need to share sessions table between 2 sites (same domain, eg. .mysite.com). In drupal 7, i have already build this in settings.php.

I have created a new database for this.

On drupal 10/11, this seems different, because we cannot achieve this on the database definition in the settings.php. But maybe that's a mistake.

Should I use another method, create a custom service for this?

Thanks for your help.

1
  • I tried to build a custom services.yml files with this code : services: database.shared: class: Drupal\Core\Database\Connection factory: 'Drupal\Core\Database\Database::getConnection' arguments: ['shared'] sessions_shared.handler: class: Drupal\Core\Session\SessionHandler arguments: - '@request_stack' - '@database.shared' - '%session.storage.options%' tags: - { name: session } ...with no success.... Commented Jan 21 at 14:22

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.