NYCPHP Meetup

NYPHP.org

[nycphp-talk] When to close a mysql connection

David Krings ramons at gmx.net
Mon Jul 2 10:58:01 EDT 2007


Cliff Hirsch wrote:
>> Although I should know if I use database-based sessions, I am not sure
>> as I am not sure what exactly a database-based session is. So, what is that?
> 
> Standard PHP sessions are stored in flat files on the server. Not conducive
> to scale-out as the session is local to a specific server, and there can be
> security issues in a shared hosting environment. One alternative is to store
> your sessionz in a database.
> 
> See: http://us.php.net/manual/en/function.session-set-save-handler.php
> 
Aha! So, if I'd have multiple servers and want to carry a session from 
one server to the next I could do so via a database assuming that the 
servers each have access to it. Now that's clever!
Writing to each own's database will keep the session stuff separated for 
shared hosting. Good to know.

And again, NYPHP in persona of Cliff Hirsh made me a smarter person.

Thanks!

David



More information about the talk mailing list