Xenforo Session among third domains


New member
I have xenforo installed on a 3rd domain of my website: forum.studentville.it

I would like to read the session (if it is open) on the others 3rd domain (ex. www.studentville.it)

I am using Xenforo SDK https://xenforo.com/community/resources/xenforo-sdk.2790/.

If a user is logged in with Facebook it work, the sdk is able to take the current session and getUser() functions returns the right logged user.

If I log in using username/email and password, getUser() returns an empty array. I think because is not able to read the session (instead if facebook is active he is able to read the facebook session).

I tried to add in the config files this lines of code but it looks like it's not working.

$config['cookie'] = array(
'prefix' => 'xf_',
'path' => '/',
'domain' => '.studentville.it'

Do you have any suggestion?


Jeff Berry

Well-known member
Have you tried something like this? (this must be called before the session is started)



New member
Hi, I tried all this solution but they did not work. I solved with an iframe at the end of the template that calls
a page I setted up, passing few parameters in order to open with safety new session and cookie in the rest
of the website.

When a user logs out, this parameters are null and I delete sessions ad cookies.