fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
+fastcgi_param COOKIE_STRING $http_cookie;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
--- /dev/null
+compile with:
+gcc test.c -lfcgi -o test
+
+Run with:
+spawn-fcgi -p9005 -n ./test
+
+nginx must be configured to pass $http_cookie as an evironment variable named COOKIE
\ No newline at end of file
--- /dev/null
+#include <fcgi_stdio.h>
+#include <stdlib.h>
+int main() {
+ while (FCGI_Accept() >= 0) {
+ printf("Content-type: text\r\n");
+ printf("Set-Cookie: name=value with spaces; and a semicolon\r\n");
+ printf("Set-Cookie: name2=value2\r\n\r\n");
+ printf("Cookie:%s\n", getenv("COOKIE_STRING"));
+ }
+}