View Full Version : logging into a subdomain from a top level domain

11-10-2007, 10:19 PM
I have a website with a login system and a subdomain with phpbb installed. I would like to set it up so that when someone logs into the top leveldomain it automaticly logs into the subdomain but am at a loss as to how to do this. if it were on the same level it wouldn't be a problem but because of the subdomain it is giving me a headache. I have searched google to try and find the answer but couldn't. I was hoping someone could steer me in the right direction of how to do it. Not anything specific but just a general idea of what I would need to do.

11-10-2007, 10:49 PM
This could probably be done by using the cookies used by phpbb for the whole domain

setcookie('username', 'username', '/', '.domain.com');
// The last parameter is important if you want the cookie to be used across subdomains

Obviously you would have to find out which cookies phpbb uses and set them on the tld.