How to send COOKIE, PHPSESSID from my own webserver to php5-cgi script
I am developing a Webserver in C. I know how to pass environment variables to ph5-cgi, eg:
putenv(
putenv(
putenv(
putenv(
and start php5-cgi as child,
execl("
Actually this logic works for all PHP pages which dont have session_start() or which doesn't use SESSION["username"] = $username;, codes.
That is, I get COOKIE variable from browser,
Cookie: PHPSESSID=
Istored this PHPSESSID in C variable phpsessid. So now,
phpsessid=
The problem is I failed to pass the COOKIE from my webserver to php5-cgi script.
HOW CAN I PASS/FORWORD the COOKIE/PHPSESSID value to php5-cgi script to validate the user in php pages?
Any ENVIRONMENT variable do I need to set?
Or do i need to write into STDIN of the script?
here is the SESSION check in my php page,
if(!$_SESSION[
header(
}
Here I failed to check $_SESSION[
The cgi script send back to my server an error:
PHP Notice: Undefined index: valid_user in /home/WEBSERVER
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Ubuntu php5 Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: