The following GCGI test program will set cookies, read those cookies, or just print out the headers sent back by your browser depending on which button you press.
Here is the code to make this happen: