Hello,
im building a very small forum and when an user logs in i need to "save" ths users id in a global variable so that i can easily access it on every page. For this i use:
session_start();
if (!isset($SESSION['id'])) {
$SESSION['id'] = $id;
} else {
$id = $_SESSION['id'];
}
And it was working fine untill i found a very strange 'bug'. I left my browser on (twice) with my page loaded in it. When i came back 1-2 hours later and click on refresh button something very strange happens... everything that is using the $id stops working and when i try to print the $id at this state i get nothing!! Empty?!?!
The only solusion is to close the browser and open a new one...
Pls help!
Thanks!