0

Hi I'm currently working on login process.

the problem is I have 2 repositories in one Ubuntu server and they have their own domain names like first.blablabla.com and second.blablabla.com.

and I'd like to share session for users to keep logging in both domains. But for few days of search, there is not enough information for me to figure this out.

The framework is Cakephp3 and it doesn't provide such an API.

Thanks in advance.

  • 2
    This thread might be useful, http://stackoverflow.com/questions/14611545/preserving-session-variables-across-different-domains. – chris85 Oct 23 '15 at 04:40
  • Hi eric here's a wild idea... You can create an action in both your domains that will talk to each other, on beforeFilter event in your AppController, to sync the Session information. – akashBhardwaj Oct 23 '15 at 04:43
  • chris' idea seems more practical though :) – akashBhardwaj Oct 23 '15 at 04:44

1 Answers1

2

You can store sessions in common session storage ( for example database or redis), the idea is to have possibility to connect to storage service from any domain's server. Also you should make authorization on root domain blabla.com/login/ to make cookie available on both subdomains.

Stafox
  • 1,007
  • 14
  • 25