[dev] Process for session creation?

Chuck Hagenbuch chuck at horde.org
Sat Oct 15 13:31:59 PDT 2005


Quoting "Kevin M. Myer" <kevin_myer at iu13.org>:

> After that initial write, is when Apache dies.  My question is that 
> the correct process that a session creation should go through?

Sounds okay.

> Also, a question about persistent connections.  The various PHP 
> functions that
> are used to close Horde SessionHandlers (eg. mysql_close and memcache_close)
> don't do anything if mysql_pconnect or memcache_pconnect were called
> (persistent connections are only closed on shutdown of web server).  But,
> irregardless of whether a connection is persistent or not, 
> $this->_connected is set to false in the close function.  So when 
> $this->_connect is called for a persistent connection the second 
> time, $this->_connected is false and a new
> connection is opened.  I've gone around and around on whether this matters or
> not, but it doesn't seem right to me.  Given the still not quite 
> right behavior of at least the MySQL session handler, could this be 
> the cause of it?

No. First of all, what you describe would only happen if a session was 
opened/closed multiple times on the same page. $_connected does not 
persist across requests, just like any other PHP variable. Second, even 
in that case, the _pconnect functions don't open a "new connection" if 
there's already a persistent one - they return the existing persistent 
connection. That's the whole way persistent connections work.

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the dev mailing list