I
I
Ilya Plotnikov2014-09-11 02:07:43
Yii
Ilya Plotnikov, 2014-09-11 02:07:43

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

2 answer(s)
S
Sergey, 2014-09-11
Protko @Fesor

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.

M
Mikhail Osher, 2014-09-11
@miraage

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 question

Ask a Question

731 491 924 answers to any question