DV-JF Posted September 16, 2020 Share Posted September 16, 2020 Hey all, short question: I've setup a multi-language site using different domains for the different languages in site/ready.php I'm using following code: <?php if($config->httpHost == "www.example.de") $user->language = $languages->get('default'); elseif ($config->httpHost == "www.example.si") $user->language = $languages->get('si'); elseif ($config->httpHost == "www.example.com") $user->language = $languages->get('en');?> All domains are mapped into the same directory - this is working superfine ? Now I have to take care about following use case: If a user is logged in and wants to change the language, the session have to be automatically transferred to the refering domain, so that the user having not to log in again. IS this possible? Can you give me some hints on how to do this best with the current PW version? Link to comment Share on other sites More sharing options...
LostKobrakai Posted September 17, 2020 Share Posted September 17, 2020 Since sessions are maintained by cookies and cookies are bound to domains the answer is no – you cannot share a session between domains. What you can do is have only a single domain handle authentication, and all other domains fetch information from that service. See for example oauth or openid connect systems. That‘s rather complex though and not something available in processwire as is. 1 Link to comment Share on other sites More sharing options...
DV-JF Posted September 24, 2020 Author Share Posted September 24, 2020 Thank you for your answer - I'll think I'll have a look at https://processwire.com/api/ref/session/force-login/ Maybe I'll use a unique hash field which changes automaticly after the user is logged in. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now