I have a strange problem with sessions and session_register it would appear.
I am using a Microsoft C API call (URLDownloadToCacheFile) to download a web
page from a RH6.0/apache/php4 server installation.
Some background... The download call will work everytime with direct file
locations from the server (http://myserver/mydir/myfile).
My PHP script delivers files from another location away from the root web
location on the server so that direct access is not possible. I am using
fopen and fpassthru to do this. This works fine.
I wanted to use a session to control access to the file pass thru routine.
This is where I start to have problems.
Everything is fine up until a call to session_register. The download starts
to fail sporadically when with a PHP session when I use the session_register
function.
So:
session_id($s); file://ok
session_name("del"); file://ok
session_start(); // ok
session_register("MYVAR"); // causes downloads to start to sporadically fail
session_destroy(); // if called directly after session_register, then
problem goes away!!
On 100 calls it will fail 40 odd times. Its normally consistent failure.
I am thinking that something specific is happening after the
session_register call, like a cookie exchange or header being sent which is
knocking out the download every so # of calls.
Does anyone have any ideas that I use to stop this from happening ?
I don't want to remove sessions from the script, but currently that is the
only way to get around then problem.
Regards
Richard