Just now verified that, PHP session variable is overwritten by declared variable with same name. i.e) I have session variable $_SESSION['lan'] = 'xyz' (global variable) and one of my PHP page x.php having variable $lan in foreach loop, at end of this loop my $_SESSION['lan'] is overwritten by last value of the array which is used in foreach loop.
I mean $_SESSION['lan'] having value ‘abc’ and that lan $_SESSION global variable became ‘abc’ hereafter.
Make sure that
register_globalsisoff.