Session variable works on local server, but not on hosting server
问题 I am developing a simple php/mysql discussion forum. The statement <?php print $_SESSION['username']; ?> produces the desired results on my local machine, but when I uploaded the code to test the forum live, the value of the session variable no longer displayed. What could be causing this? 回答1: one thing that can cause this is if the live web server is on a load balanced environment using default php session handling. By default php stores session data in a flat file on ther server so if the