Answer the question
In order to leave comments, you need to log in
Is it possible to consolidate authorization in Yii across multiple domains?
The same site in different languages is located on the ru and com domains. Is it possible to make sure that when moving from one domain to another, the user remains logged in?
Framework 1.x
Answer the question
In order to leave comments, you need to log in
Yes, it's possible. You just need to figure out how to merge sessions on different domain names.
When authorizing on domain A, you can insert a link (for example, a picture) with an identifier / token to domain B. When processing a picture request, merge sessions.
Store sessions in a database/radish.
Perhaps you need to set the id in the application config so that it is not calculated dynamically.
// upd
Here is an example of my config in one of the projects
'session' => [
'class' => 'CCacheHttpSession',
'cacheID' => 'redis',
'sessionName' => 'SESSIONN',
'cookieParams' => [
'httponly' => true,
'domain' => '.' . $_SERVER['SERVER_NAME'],
],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question