I’ve built an environment where there are a few domains that (if you join and login) you end up iframe’ing onto one central domain.
eg:
domain1.com -> join/login -> centraldomain.com
domain2.com -> join/login -> centraldomain.com
domain3.com -> join/login -> centraldomain.com
domain4.com -> join/login -> centraldomain.com
The only issues I’m having is the $_SESSION on centraldomain.com is overwritten by each domain that logs in – eg: in the session is the originating domain name.
Is there a way to get a unique number/string for each different connection that persists on the server or php that could be used to prefix $_SESSION variables so I can separate the different originating domains with differently names $_SESSION vars?
Or another concept around this?
Take a look at
session_set_cookie_params(). Using this function you may be able to set the scope of $_SESSION variables in a domain-wide basis:or