You are here: Re: cookie question « HTML « IT news, forums, messages
Re: cookie question

Posted by Jim Hayter on 12/20/05 07:16

Eric wrote:
> I'm playing around with cookies mostly as a learning experience.
> I cant seem to get an html page to set a cookie. I'm a bit confused
> about headers , which to send first etc.
> Here's my strategy
> ....
> <body>
> <!--#exec-cgi="/cgi-bin/setcookie.cgi" -->
> </body>
>
> The cgi just writes
> "Set-Cookie: hello=its_me" to stdout
> My question is:
> is this correct?
>
> int main(void) {
> printf("Set-Cookie: hello=its_me\n");
> printf("Content-type: text/html\n\n");
> return 0;
> }
>
> Because i dont see a cookie show up on disk on the client side.
> And there are no errors in my apache 2.2 logs (linux based system)
> And also, my client is IE6 on windows and its not blocking cookies.
> I watch the cookies dir under Documents and settings and the cookie
> never shows up, although i can see cookies arrive from other places
> like google.
> Can someone straighten me out here?
> Thanks
> Eric
>

Just a thought. If you don't provide an expiration date, you may be
setting a session cookie. Session cookies don't get written to disk,
they are kept in memory so they go away at the end of the session.

HTH,
Jim

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация