You are here: Odd cookie behavior « PHP Programming Language « IT news, forums, messages
Odd cookie behavior

Posted by Chuck W. on 01/10/06 13:41

I'm processing a form, and on the target posting page, I'm setting
cookies for the name/value pairs like this:

while (list($name, $value) = each($HTTP_POST_VARS))
{
if ( $value <> NULL ) {
setcookie($name,$value,time()+3600*24*30*12*10);
$mystring = "<input type=\"hidden\" value=\"$value\" name=\"$name\">\n
$mystring";
}
}

Now after posting when I go back to my original form with the same URL
path,

www.mydomain.com/mypath,

I can see that the cookies are there because the values appear in the
fields like we'd expect. However if I put the very same form in a
different directory, eg: www.mydomain.com/secondpath then the cookied
values no longer appear.

I knew that cookies could be domain specific, but is there a setting
that makes them somehow directory specific??

Thanks,

Chuck

 

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

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