Page 1 of 1

session.save_path advanced or impossible?

Posted: Sat Oct 11, 2003 5:57 am
by Antiloop
I have developed a custom sessions class which manages my sessions via a database and also uses some of php's built it session features, mainly the session_id() function to identify the current session throughout my entire script. Which is fine and works great.

Here is my delemma. I have been developing this software for a gaming network which has a several game sites as well as a main site. What we wish to do is to to extend the login system to include the entire network. Example: you log in on the main site, then travel to a game site and you maintain your logged in status. All the sites are on the same server, and have access to the same mysql databases. but they all have there own domains and files (by that i mean like /home/sites/gamesite1.com/public_html and gamesite1.com etc.

what we are hoping todo is to change the session save path for the entire server to a specific directory example: /home/sites/tmp/ so every site hosted on the server will have its session information in that folder. which we are hoping will be the answer, the thing is we dont want to go and do it and have it screw up the entire network :D

Basically we want to know if it is possible. We cant think of any reason why it wouldnt but we have had conflicting opinions from several developers.

If we find it wont work we will probably have to resort to multihosting the domains to directories off the main site example: gamesite1.com -> goes to mainsite.com/gamesite1/ but we dont know if this will work either and essentially we like to keep the communities as individual entities.

Please help, any ideas would be greatly appreciated.

This might be helpful

Posted: Sat Oct 18, 2003 7:19 pm
by Gremlin
Haven't looked at it yet, but it showed up in my inbox. Sounded appropriate.

http://www.phpclasses.org/browse.html/package/1353.html

Posted: Sun Oct 19, 2003 6:01 pm
by hedge
I'm confused. If you're saving the session info in the db, what does the session_save_path have to do with it, that would be where it wrote he files, but as you've replaced this with db storage how is that relavent?

I think you're bigger problem would be the cookie that php sends to the browser to maintain the sessionid, cookies are domain dependent and I don't think it would know that it's from the same server.