Closed Bug 325881 Opened 19 years ago Closed 14 years ago

Multiple execute of php functions on page load and another execute for every tab swap

Categories

(Firefox :: General, defect)

1.5.0.x Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: magnetronnie, Unassigned)

Details

(Whiteboard: [CLOSEME 5-15-2010])

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1

I created a php function (see additional information) and everytime the page loads, the function is recalled 5 times. Everytime I swap tabs between another page and the page with the function on it, the function is recalled again, eventhough the page itself is not reloaded. Although tested with Internet Explorer 6 the page only recalls the function 1 time and things work perfect.

Reproducible: Always

Steps to Reproduce:
See additional information for an example function.
Actual Results:  
The session starts with 0.
The session is increased by 5 the first time you load the page, or when you hit refresh.
The session is increased by 1 everytime you swap tabs with another page (i.e. a tab with google.com).

Expected Results:  
The function should only be recalled once in the entire pageload, and never when swapping between tabs.
In our case we where creating a visitor counter and we ran into this problem.

Function used:

<?php
session_start();
function counterTest(){
	$_SESSION['counter'] = $_SESSION['counter'] + 1;
	echo $_SESSION['counter'];
}
counterTest();
?>
Please can you test in firefox's safe mode (http://kb.mozillazine.org/Safe_mode)
Tested in FF safemode and the problem isn't there anymore.
I have 5 extensions installed: DOM Inspector 1.8.0.1, TalkBack 1.5.0.1, SwitchProxy Tool 1.3.4, Web Developer 1.0.2 and Google Toolbar for Firefox 1.0.20051122. One of these addons may cause the problem I think. I try to find out which one is causing the problem and why.
This is caused by an extension, so not a Firefox bug.

This looks very similar to bug 317920 though the reporter there determined that it was fasterfox causing the issue so this is not a straight dupe I think.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
I tested the function on a blank page and it was gone while working in FireFox safemode, but I was to soon with my conclusion. While working on my own website in safemode the bug appeared again. The function is not called multiple times in Internet Explorer so I can't be something in my website, maybe a combination of this function with something else? Any idea how I can try to find out what's causing this?
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
After some searching I think I have found the bug. I'm using an apache feature to tell the webserver that index instead of index.php should be executed through php.
The following code is in de .htacces file:

<files index>
  ForceType application/x-httpd-php
</files>

and that's most likely causing the problem.

So when I go to http://localhost/testfunction.php, it's working fine, but when I go to http://localhost/index it's calling the function multiple times.
Is this any helpful?
What is calling the function multiple times?

Is that correct way of using the Apache Forcetype configuration setting?

When as the user sitting in front of Firefox you request the resource whose
URL is http://localhost/index , how amny requests does Firefox make. Are these
for directories or files (if it matters)? How many times does Apache call your 
engine?

You may have to check various logs for this, perhaps use the HTTP log 
generation in Firefox and perhaps the LiveHTTPHeaders extension.

You will probably get more detailed help in forums such as 
http://forums.mozillazine.org/viewforum.php?f=8 ; as there seems to be no
forum whose mission is perfectly aligned with your problem, you may want to 
hunt around before posting.

Good luck.
I have had this same issue with Firefox 2.0.x and 3.0 when connecting to my BlueDragon server.

If the page accessed is very simple this doesn't seem to happen, but as more images, css includes, and JS includes are added Firefox begins to request the original page multiple times.  I've seen this reach as high as 5 requests, which is really messing with my logging.
This bug was reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.3 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Whiteboard: [CLOSEME 5-15-2010]
Version: unspecified → 1.5.0.x Branch
No reply, INCOMPLETE. Please retest with Firefox 3.6.x or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago14 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.