Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Evil Bill

CGI & Cookies (C++)

This topic is 5776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i'm having more than a little difficulty with cookies in my CGI program. The program is written in C++, running under Apache. I've sent a "Set-Cookie:" line, but no cookie is created (i've emptied out my cookies folder to check). Heres my code:
int main(int argc, char* argv[])
char szBuff[4096];
int nLen;
   printf("Set-Cookie: username=Steve;\n");
   printf("Content-type: text/html\n\n");
   int nLen = fread(szBuff,1,4096,stdin);
   szBuff[nLen] = 0;
   printf("%s (%d)",szBuff,nLen);

   printf("<br><a href=\"CookieTest.exe\">Click</a>");
   return 0;
I've tried setting the "domain=" part, but that has no effect either. Edit: Oh, and nothing is displayed apart from "(0)" and the "Click Here" link. Any ideas? [edited by - Evil Bill on December 2, 2002 4:36:27 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!