Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant have user logged in between subdomains with hybridauth. #178

Open
eleiva opened this issue Jan 22, 2014 · 1 comment
Open

Cant have user logged in between subdomains with hybridauth. #178

eleiva opened this issue Jan 22, 2014 · 1 comment

Comments

@eleiva
Copy link

eleiva commented Jan 22, 2014

Hi All!

I'm working in a multidomain site and i need to maintain user logged in between sub-domains.

So I have this config in my main.php

  'session' => array(
        'savePath' => '/tmp',
        'cookieMode' => 'allow',
        'cookieParams' => array(
            'path' => '/',
            'domain' => 'mydomain.com',
            'httpOnly' => true,
        ),

It works great, i can login in foo.mydomain.com and stilll logged in when access another.mydomain.com, so only left to do the same with hybridauth .

So i change baseUrl in hybridauth.php ( config )

return 
  array(
    "base_url" => "http://".$_SERVER['SERVER_NAME'] ."/hybridauth.php",
...

But i get

You cannot access this page directly.

The problem seems to be in the session.
When i remove yii session config detailed before, i could login with both domains but without sharing info ( i have to login twice first in foo.mydomain.com and next in another.mydomain.com )

Any Ideas?

@SacDin
Copy link

SacDin commented Oct 3, 2014

I came across the same problem and figured out this way :

Go to Storage.php file in your Hybrid extension directory and add following line on top in the __construct() method

session_set_cookie_params(0, '/', '.yourdomain.com');

Eureka !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants