CodeIgniter Forums
session in different sub -domain - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: session in different sub -domain (/showthread.php?tid=79074)



session in different sub -domain - pws - 04-17-2021

I have 3 differnt sub domain and each one have the login of user..
I want every time the user do login/register from any sub domain redirect to other subdomain where will see his panel..
How i can do this with session?


RE: session in different sub -domain - includebeer - 04-17-2021

I'm not sure if it can be done. Have you tried to set the session save path and the cookie settings to the same thing in your 3 subdomain so they use the same session data?


RE: session in different sub -domain - pws - 04-18-2021

Hello, thanks for your reply..
How i change path and cookies settings? and what must i write?


RE: session in different sub -domain - includebeer - 04-18-2021

Read this page: http://codeigniter.com/user_guide/libraries/sessions.html#session-preferences
I'm not sure it would work, but you can try. Set the same directory for your session data (sessionSavePath) and set the cookie for your main domain so it can be used by all 3 subdomain (cookieDomain and cookiePath). But again, I'm not even sure this would work.