Help - Search - Member List - Calendar
Full Version: PHP Sessions
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
Jure Erznoznik
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?

Apache works just fine, but it keeps the sockets open (I can't do that with
Indy due to some unresolved issues).
What's even more interesting, Firefox will not start a new session / will
keep sending the cookie even if I open a new window (with apache).

Any help would be greatly appreciated,
Jure

Colin McKinnon
Jure Erznoznik wrote:

QUOTE
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.


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.