I use PHP with postgres, and am getting a strange problem:
In some instances, using sessions causes the DB connection to fail, but ONLY the first time I run the script in question. If I refresh the page, it all connects fine and stays OK for the rest of the session. If I close the browser and come back later, the same problem recurs. It's not a caching thing, since I've tried it on various different computers.
Changing from sessions to cookies cures the problem, but I use sessions a lot and don't want to have to change all my code.
Any ideas?