Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: PHP Multisite Login
02-26-2013, 08:13 PM #1
- Join Date
- Feb 2013
- Thanked 0 Times in 0 Posts
PHP Multisite Login
I have been trying to get a multisite login system working. For example, a user goes to site1.com, logs in using login.site1.com, and is logged in on site2.com as well. I have tried cookies, but site2.com cant access site1.com cookies. I'm stuck with sessions, which I can't figure out, when I pass the session id through the url, I get a session id too long error. I've read that you can use mysql to do that, but how would you do that?
02-26-2013, 08:35 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
Sessions won't help you either, at least not by themselves.
The only thing you can do for multisite logins is to have ownership of both sites, and either share a database or have one site query another for information through something like soap or rest or whatever. Cookies cannot be shared between two sites (although they can be shared with subdomains). When the request is received which will need to use the GET for the phpsessid, than it should process it per normal on either site. If they share the same filesystem or database, then you can use the session information on either site.
Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');
02-26-2013, 11:14 PM #3
you need to use a database that both sites could access
a bit of ajax should sort out the cross site bit
There are 10 types of people on CodingForums,
Those who understand Binary and those who dont.
Get Cloud Hosting now from only£59 / month