Jump to content

Why is FireFox hitting my server twice?


NotionCommotion

Recommended Posts

With only FireFox, I am getting some strange extra hit to my server soon after the first one.  It seems simlar to when the browser is looking for favicon.ico, but I have an empty file in my public root.  For troubleshooting, I added the following to my script, and have posted the results.  The culprit appears to be: [HTTP_ACCEPT] => image/png,image/*;q=0.8,*/*;q=0.5

 

What could be causing this?  Even if you don't have an exact answer, any suggestions on what to look for would be appreciated.

$old_server=isset($_SESSION['server'])?$_SESSION['server']:$_SERVER;
$difference = array_diff_assoc($_SERVER, $old_server);
$difference2 = array_diff_assoc($old_server,$_SERVER);
$_SESSION['server']=$_SERVER;
echo('$_SERVER<pre>'.print_r($_SERVER,1).'</pre>');
echo('$old_server<pre>'.print_r($old_server,1).'</pre>');
echo('$difference<pre>'.print_r($difference,1).'</pre>');
echo('$difference2<pre>'.print_r($difference2,1).'</pre>');
syslog(LOG_INFO,print_r($difference,1));
$_SERVER

Array
(
    [REDIRECT_HTTPS] => on
    [REDIRECT_SSL_TLS_SNI] => test.sites.example.com
    [REDIRECT_STATUS] => 200
    [HTTPS] => on
    [SSL_TLS_SNI] => test.sites.example.com
    [HTTP_HOST] => test.sites.example.com
    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_REFERER] => https://test.sites.example.com/administrator/index.php?cid=2&controller=sell&id=643341356
    [HTTP_COOKIE] => BACKSESSID=5il7gj9p1f3etu37l8vk8tvur1
    [HTTP_CONNECTION] => keep-alive
    [HTTP_CACHE_CONTROL] => max-age=0
    [PATH] => /sbin:/usr/sbin:/bin:/usr/bin
    [SERVER_SIGNATURE] =>
Apache/2.2.15 (CentOS) Server at test.sites.example.com Port 443


    [SERVER_SOFTWARE] => Apache/2.2.15 (CentOS)
    [SERVER_NAME] => test.sites.example.com
    [SERVER_ADDR] => 192.168.1.200
    [SERVER_PORT] => 443
    [REMOTE_ADDR] => 192.168.1.1
    [DOCUMENT_ROOT] => /var/www/example/html_sites
    [SERVER_ADMIN] => root@localhost
    [SCRIPT_FILENAME] => /var/www/example/html_sites/index.php
    [REMOTE_PORT] => 63989
    [REDIRECT_QUERY_STRING] => admin=administrator/index.php&cid=2&controller=sell&id=643341356
    [REDIRECT_URL] => /administrator/index.php
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => admin=administrator/index.php&cid=2&controller=sell&id=643341356
    [REQUEST_URI] => /administrator/index.php?cid=2&controller=sell&id=643341356
    [SCRIPT_NAME] => /index.php
    [PHP_SELF] => /index.php
    [REQUEST_TIME_FLOAT] => 1422985053.698
    [REQUEST_TIME] => 1422985053
)

$old_server

Array
(
    [REDIRECT_HTTPS] => on
    [REDIRECT_SSL_TLS_SNI] => test.sites.example.com
    [REDIRECT_STATUS] => 200
    [HTTPS] => on
    [SSL_TLS_SNI] => test.sites.example.com
    [HTTP_HOST] => test.sites.example.com
    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
    [HTTP_ACCEPT] => image/png,image/*;q=0.8,*/*;q=0.5
    [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_REFERER] => https://test.sites.example.com/administrator/index.php?cid=2&controller=sell&id=643341356
    [HTTP_COOKIE] => BACKSESSID=5il7gj9p1f3etu37l8vk8tvur1
    [HTTP_CONNECTION] => keep-alive
    [PATH] => /sbin:/usr/sbin:/bin:/usr/bin
    [SERVER_SIGNATURE] =>
Apache/2.2.15 (CentOS) Server at test.sites.example.com Port 443


    [SERVER_SOFTWARE] => Apache/2.2.15 (CentOS)
    [SERVER_NAME] => test.sites.example.com
    [SERVER_ADDR] => 192.168.1.200
    [SERVER_PORT] => 443
    [REMOTE_ADDR] => 192.168.1.1
    [DOCUMENT_ROOT] => /var/www/example/html_sites
    [SERVER_ADMIN] => root@localhost
    [SCRIPT_FILENAME] => /var/www/example/html_sites/index.php
    [REMOTE_PORT] => 63970
    [REDIRECT_QUERY_STRING] => admin=administrator/
    [REDIRECT_URL] => /administrator/
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => admin=administrator/
    [REQUEST_URI] => /administrator/
    [SCRIPT_NAME] => /index.php
    [PHP_SELF] => /index.php
    [REQUEST_TIME_FLOAT] => 1422985038.5
    [REQUEST_TIME] => 1422985038
)

$difference

Array
(
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_CACHE_CONTROL] => max-age=0
    [REMOTE_PORT] => 63989
    [REDIRECT_QUERY_STRING] => admin=administrator/index.php&cid=2&controller=sell&id=643341356
    [REDIRECT_URL] => /administrator/index.php
    [QUERY_STRING] => admin=administrator/index.php&cid=2&controller=sell&id=643341356
    [REQUEST_URI] => /administrator/index.php?cid=2&controller=sell&id=643341356
    [REQUEST_TIME_FLOAT] => 1422985053.698
    [REQUEST_TIME] => 1422985053
)

$difference2

Array
(
    [HTTP_ACCEPT] => image/png,image/*;q=0.8,*/*;q=0.5
    [REMOTE_PORT] => 63970
    [REDIRECT_QUERY_STRING] => admin=administrator/
    [REDIRECT_URL] => /administrator/
    [QUERY_STRING] => admin=administrator/
    [REQUEST_URI] => /administrator/
    [REQUEST_TIME_FLOAT] => 1422985038.5
    [REQUEST_TIME] => 1422985038
)
Link to comment
https://forums.phpfreaks.com/topic/294335-why-is-firefox-hitting-my-server-twice/
Share on other sites

Why would you want to display an image that doesn't exist?

 

EDIT: If you want to dynamically add an image tag from an AJAX result, then you can just add the whole image element instead of just changing the src. Or, initially set the src to a placeholder image or something.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.