CodeIgniter controllers are called twice

It is possible that I made a huge mistake somewhere, but for some reason my controllers are called twice. This breaks the DX_Auth captcha on Chrome, but somehow Firefox and IE can handle it.

The problem is that each controller receives a call two milliseconds apart. I used log_message () to print each key / value pair from the $ _SERVER superglobal file.

The only differences are:

1st call

'HTTP_CACHE_CONTROL' => 'max-age=0'
'HTTP_ACCEPT' => 'application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'
'HTTP_COOKIE' => 'ci_session=a:4:{s:10:"session_id";s:32:"4be9cef4e2cdae468c7443f52a5fb3f2";s:10:"ip_address";s:13:"321.321.321.321";s:10:"user_agent";s:50:"Mozilla/5.0+(Windows;+U;+Windows+NT+6.1;+en-US)+Ap";s:13:"last_activity";s:10:"1282151409";}70b300096c8d40c60a676ac65bcb222c'
'REMOTE_PORT' => '61828'

and 2nd call

'HTTP_CACHE_CONTROL' => NULL
'HTTP_ACCEPT' => '*/*'
'HTTP_COOKIE' => 'ci_session=a:4:{s:10:"session_id";s:32:"a5bb2c98a8ff4438cef3a3fe3d5ff73e";s:10:"ip_address";s:13:"321.321.321.321";s:10:"user_agent";s:50:"Mozilla/5.0+(Windows;+U;+Windows+NT+6.1;+en-US)+Ap";s:13:"last_activity";s:10:"1282151734";}4adf1de21f9708d66b3d4bc36d0b0d92'
'REMOTE_PORT' => '61842'

There is a thread on the CI forums where someone had a similar problem, but his problem turned out to be spyware. This does not apply to me. I tried on several computers, and none of my visitors could register on the site.

, DX_auth captcha - CI . -, .

123.123.123.123 - - [18/Aug/2010:12:31:26 -0500] "GET /welcome HTTP/1.1" 200 3391 "http://somewhere.com/[age" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.126 Safari/533.4"
123.123.123.123 - - [18/Aug/2010:12:31:27 -0500] "GET /welcome HTTP/1.1" 200 3391 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.126 Safari/533.4"

, , , , .

, .htaccess, index.php uri. , .htaccess , CI. .

RewriteEngine on
RewriteCond $1 !^(index\.php|asset|captcha|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

FireFox Live HTTP headers. , , FireBug , .

- , ? - ?

+3
4

. , , , : , --- Php

+3

, . firefox. Firefox . , . firefox. .

0

, jQuery DOM , , DOM.

0

, . , Firefox .

<meta http-equiv="Content-Type" content="text/css; charset=utf-8" />
0
source

Source: https://habr.com/ru/post/1760395/


All Articles