You are here: Re: [OT-ish] FF: weird 'view source' problem, PHP session lost « PHP Programming Language « IT news, forums, messages
Re: [OT-ish] FF: weird 'view source' problem, PHP session lost

Posted by Erwin Moller on 03/23/07 14:13

peter wrote:

> > I have a page that 'demands' a session exists:
>> Something like:
>>
>> if (isset($_SESSION['isAdmin']) && ($_SESSION['isAdmin'] == 'Y')){
>> // OK, continue
>> } else {
>> // No good. Redirect to loginpage
>> header("Location: etc/etc/etc/example");
>> }
>>
>> All very basic.
>>
>> But if I try to view the source of my page in FF by pressing rightmouse
>> button -> view source, I receive the source of the login page!
>>
>> I get the impression 'view source' makes a fresh request to get the
>> source but is not sending the PHPSESSID along with the request, thus
>> delivering the HTML of the loginpage to where I redirect.
>>
>> The box in question runs W2000 with FF2.
>>
>> Did anybody in here experience this weird behaviour (PHP session lost
>> when viewing source) with Firefox2 too?
>
> Veiw source only shows the source of the page it retrieved it does not
> request the page again to get it.

That is what I have always thought too....

After header("Location:
> etc/etc/etc/example"); you should always use exit(); to stop a script
> continuing (although i doubt it is the cause of your problem).

I know, and do that in my real code.
The above was just to show what is going on.

>
> Try posting more code as it will make it easier to see what might be
> happening.

Really, there is nothing more to post.

I have a page on FF that is NOT my login page, but some Adminpage.
I click 'view source' and see the source of the loginpage.
No matter which adminpage I visit, they are all OK, except when I want to
view the source.

Regards,
Erwin

 

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

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