You are here: Re: Logged in twice at the same time? « PHP Programming Language « IT news, forums, messages
Re: Logged in twice at the same time?

Posted by Coder Droid on 05/13/05 02:06

> Are you using two IE or two FF browser windows on the same PC to test
> this, or one IE and one FF?

It was one IE and one FF. Here's the behavior I saw:

IE, Page 1, PHP_AUTH_USER=apple
IE, Page 2, PHP_AUTH_USER=banana

FF, Page 1, PHP_AUTH_USER=apple
FF, Page 2, PHP_AUTH_USER=banana

IE on a completely different computer, Page 1, USER=apple
IE on a completely different computer, Page 2, USER=banana

At that point I ruled out the browser. Something was amiss server-side.

And I more or less figured it out, after about a hundred different
trial-and-error attempts and re-arranging call order. I won't say I
definitively figured it out, because this is still somewhat of a
mystery.

It seemed like every time "banana" showed up as the user, the http basic
auth header() calls were not being made. And if I could force the
header() call, then 'apple' would be logged in on every page. And once I
did that, I no longer had to send headers again: apple would stick.

The algorithm went like this:

if ("private" page) {
send_headers(); // force the http auth dialog
} elseif ("public" page) {
if (already been here) {
send_headers(); // does not pop up dialog, but does populate
PHP_AUTH_USER
} else {
// do nothing
}
}

Anyway, all seems to be working at this point, so I'm going to run with
it.

--cd

 

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

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