I believe the problem stems from the fact that the author
expects register_globals to be "on". By default this is now
set to "off" in php version 4.3 -- and even in earlier versions.
Thus, this code will not work with register_globals set
to "off". I'd recommend the author fix his code to work with
the more secure/default php.ini settings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have set it working by replacing the following lines 458,459
from phpSniff.core.php:
$this->_set_browser('ss_cookies',isset($cookies
['phpSniff_session'])?'true':'false');
$this->_set_browser('st_cookies',isset($cookies
['phpSniff_stored'])?'true':'false');
Logged In: NO
I believe the problem stems from the fact that the author
expects register_globals to be "on". By default this is now
set to "off" in php version 4.3 -- and even in earlier versions.
Thus, this code will not work with register_globals set
to "off". I'd recommend the author fix his code to work with
the more secure/default php.ini settings.
Logged In: NO
With register_globals set to off, the function _test_cookies()
in phpSniff.core.php needs to explicitly use $_COOKIES to
work correctly, as in:
...[snip]
$this->_set_browser('cookies',$_COOKIE['phpSniff_session']
=='ss'?'true':'false');
$this->_set_browser('ss_cookies',$_COOKIE
['phpSniff_session']=='ss'?'true':'false');
$this->_set_browser('st_cookies',$_COOKIE['phpSniff_stored']
=='st'?'true':'false');
setcookie('phpSniff_stored','');
[snip]...
Logged In: NO
I have set it working by replacing the following lines 458,459
from phpSniff.core.php:
$this->_set_browser('ss_cookies',isset($cookies
['phpSniff_session'])?'true':'false');
$this->_set_browser('st_cookies',isset($cookies
['phpSniff_stored'])?'true':'false');
By:
if(isset($cookies['phpSniff_session']) && $cookies
['phpSniff_session'] === 'ss') {$phpSniff_session = true;} else
{$phpSniff_session = false;}
if(isset($cookies['phpSniff_stored']) && $cookies
['phpSniff_stored'] === 'st') {$phpSniff_stored = true;} else
{$phpSniff_stored = false;}
$this->_set_browser('ss_cookies',$phpSniff_session);
$this->_set_browser('st_cookies',$phpSniff_stored);
Enjoy!!