Posted by Colin McKinnon on 06/16/05 16:51
Jure Erznoznik wrote:
> I have a rather specific problem with PHP sessions:
>
> When used together with Nevrona's Indy HTTP server, they seem to get lost
> and recreated all the time.
> Practically every page I try to access from my browser starts a new
> session.
>
> How does PHP control sessions and more importantly, how does it know that
> a new connection was established?
> Does it all depend on KeepAlive socket property? Then again, how does PHP
> know that it is a NEW socket that is established, not a previous one
> reused?
Nothing to do with keepAlive. PHP generates a 'handle' to some data stored
server-side (in a file by default) which is automagically loaded by PHP
when a PHP page is hit with a valid handle in the request.
Typically this is passed to the client as a cookie, and therefore requires
that PHP be able to set headers. Having never heard of "Nevrona's Indy" I
would take a guess that it's a header issue.
RTFM for more info on sessions - see also setcookie for testing.
C.
[Back to original message]
|