Reply to Re: i can't set a cookie? Or is it a Windows problem?

Your name:

Reply:


Posted by lawrence k on 11/08/07 20:33

On Nov 8, 2:12 am, jamesgoode <ja...@jgoode.co.uk> wrote:
> On Nov 8, 5:02 am, lawrence k <lkrub...@geocities.com> wrote:
>
>
>
> > This site was working:
>
> >http://www.thesecondroad.org/
>
> > Now I'm told people are unable to create new accounts or log in.
>
> > One theory: It seems that cookies are not being set. Our beta testers
> > missed this bug, because the code was working at some point, and so
> > cookies got set to the computers of the beta testers. I have no
> > problem logging in, nor does anyone on my team have any trouble.
>
> > Another theory: the above theory can't be right, because if I erase
> > all my cookies and start over, I still have no trouble going to the
> > site and logging in. Tonight I'm using FireFox on a Mac, but I've
> > tested the site on Windows, Linux and Macs, using FireFox, IE 6 and 7,
> > Safari and Opera. Everything works for me. The people who can't log
> > seem to all be on Windows machines. Could there be a problem specific
> > to Windows?
>
> > Another theory: there is white space at the top of some pages, which
> > keeps cookies from being set. I've told the graphic designers that
> > this is good:
>
> > <?php
>
> > and this is bad:
>
> > <?php
>
> > that first white space, at the top of the page, will kill the
> > possibility of setting a cookie. However, like I said, it seems
> > cookies are being set on my machine. And we've looked for white space
> > at the top of the pages and we have not found any.
>
> > Here is the code where I set the cookie:
>
> > $machineId = $_COOKIE["machineId"];
> > if (!$machineId) {
> > if (!headers_sent()) {
> > $machineId = md5(uniqid(rand()));
> > $success = setcookie("machineId", $machineId,
> > time() + 10000000);
> > } else {
> > $controller->error("In logPageVisit() we
> > wanted to set a machine id but the headers were already sent.");
> > }
> > }
>
> > Anyone see any problem with that?
>
> > As to the folks running Windows, I've asked them to turn off
> > firewalls, and lower their security settings to the lowest possible
> > levels. They still can't log in. The problem effects both IE and
> > FireFox.
>
> > Any thoughts about where I should look for trouble?
>
> Hi Lawrence,
>
> I'd check that the PHP files are all ANSI - there are some problems
> with other formats that stop cookies working.


Actually, the few times I've needed to put in some character encoding,
I've chossen UTF-8. But that should work fine, yes?

[Back to original 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

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