Q:

php Aruba $_session issue

I'm testing this code in Localhost and on Server "Aruba".
In local environment it works perfectly while on Server I dont have the expected session value
When I echo out the $_SESSION['lang'] it outputs :
-the correct country code (Ex.'en') in localhost
-On the Aruba server $_SESSION['lang'] outputs the array named $lang (that you can find on lang.en.php)instead of the needed country code!!
Where am I wrong?
thanks
Luca
my home.php
require_once('/web/htdocs/www.mywebsite.com/home/includes/langSwitcher.inc');
echo $_SESSION['lang'];
[..]

my langSwitcher.inc
session_start();
header('Cache-control: private'); // IE 6 FIX

if(isset($_GET['lang']))
{
$lang = $_GET['lang'];

// register the session and set the cookie
$_SESSION['lang'] = $lang;

setcookie('lang', $lang, time() + (3600 * 24 * 30));
}

else if(isset($_SESSION['lang']))
{
$lang = $_SESSION['lang'];  
}

else if(isset($_COOKIE['lang']))
{
$lang = $_COOKIE['lang'];
$_SESSION['lang']=$lang;
}
else
{
$lang = 'en';
$_SESSION['lang']=$lang;

}

switch ($lang) 
{
 case 'en':
 $lang_file = 'lang.en.php';
 break;

 case 'it':
 $lang_file = 'lang.it.php';
 break; 

}

include_once $lang_file;

my lang.en.php
/*
-----------------
Language: Italian
-----------------
*/

$langcode='en';

$lang = array();

$lang['PAGE_TITLE'] = 'pagetitle';

$lang['HEADER_TITLE'] = 'title header ';

$lang['SITE_NAME'] = 'name site';

$lang['HEADING'] = 'title';

A:

It sounds like register_globals may be enabled (although that feature is deprecated). You can find out by running a phpinfo() and looking for the register_globals entry.
Assuming it is enabled, the only solution is to fix it in php.ini (you cannot override register_globals with an ini_set() call).

