well this is really weird so i got this code for timeout user so he automatically logs out if 500 second passed since last time being active i put this in the upper bar since it's on all my pages
if(!isset($_SESSION))
session_start();
if(isset($_SESSION['time']))
if ($_SESSION['time'] + 600 < time()) {
session_destroy();
} else{
$_SESSION['time'] = time();
//some code to access database that says welcome and shows some details about the account and manage account and stuff
}
<div class="signIn"><?php
if(isset($_SESSION['USER_State']) && ($_SESSION['USER_State'] === true)){
echo "<a href='SignOut.php'><p>Sign out</p>";
} else {
echo"<a href='Registeration.php'><p>Sign In</p>";
}?></div>
well this works but there is a problem when 600 second passes it destroys session when user press on any link and the welcome and stuff does not show anymore but still it echos Sign out instead of sign in although when i checked the page source from browser i found this
<td>
<div class="signIn"><a href='Registeration.php'><p>Sign In</p></div>
</td>
</tr>
i checked a zillion times always the same sign out in display but sign in in source how is that possible