Sessions, Cookies, and Subdomains
Posted: Mon Dec 02, 2002 6:28 pm
Hello, I've a bit of a problem and was wondering if anyone out there can help straighten it out. Up until this point I have been using a very customized version of PostNuke for my website but things are to the point where I need to just make my own system from scratch. I want to use php sessions for my user system because they seem to be more transparent to the visitor, but there are a few problems that I think I am going to run into based on what I've read. I want to have my website split into several subdomains with a shared user system. That is to say that when someone logs into foo.mysite.com they'd also be logged into bar.mysite.com when they go to it. It is my understanding that php sessions will not work in this way, being that each subdomain has its own sessions. If this is the case, is there a way around this? If it is the case and there isn't a way around it, is this able to be done with regular cookies? Also, php sessions only last a certain amount of time. I'd like for users to remain logged in indefinitely if they choose to do so while logging in. Assuming this is absolutely impossible in sessions, is it feasible to use php sessions as the basis of my user system and cookies as a secondary to it if users choose to remain logged in? Any help at all would be really appreciated, because I'd like to get the new version of my site rolled out soon.