Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Using the qa_users table of the main forum in a second forum

+2 votes
116 views
asked Jul 30, 2017 in Q2A Core by q2apro
edited Jul 30, 2017 by q2apro
Next to my main site I plan to create another forum with another purpose (thus on another domain!).

I want the users from my main site to log-in into the new forum site - with their existing logins.

I found https://github.com/q2a/question2answer/blob/dev/qa-external-example/qa-external-users.php which seems quite complicated at first glance.

Questions:

1. Is there any easy way to just tell q2a to use the other database's qa_users table instead?

2. Has somebody done something like this already? If so, what would be the code of qa-external-users.php?

3. What else to consider?

Thanks for sharing your experiences and ideas.

Kai
Q2A version: 1.7.4
commented Jul 30, 2017 by Scott
Are both sites on the same server? Do they share the same database (with different prefix) or are they separate databases?

1 Answer

+2 votes
answered Jul 30, 2017 by ProThoughts
selected Jul 30, 2017 by q2apro
 
Best answer
commented Jul 30, 2017 by q2apro
It would be nice but I guess, they need to have the same session folder. Basically "You cannot set cookies for another domain." - https://stackoverflow.com/q/6761415/1066234 I need more testing to find out what define('QA_COOKIE_DOMAIN', '.myq2asite.com'); can do. Maybe there is some workaround...
commented Jul 30, 2017 by ProThoughts
I checked for subdomains but not for diff sites. Let us know the problems you see for diff domains.
...