this is my name.php
<?php 
    session_start();
    $now = time();
    if ($now > $_SESSION['expire']) {
    $id['success']=false;
    }else{
    if(isset($_SESSION['username'])){
    $id['success'] = true;
    $id ['userObj']= $_SESSION['username'];
    }
    }
    echo json_encode($id);
     return;
    ?>
this is my logout.php
<?php
 session_start();
 unset($_SESSION['username']);
 //$a['success'] =false;
 if(session_destroy())
 {
    $a['success'] =true;
 }
 echo json_encode ($a);
 return;
?>
As i am using jquery , ajax to get response from php
when i click logout button in html home page after time out the page is not going in html home page
But i click logout button before time expire , the page is going back to html home page and error is showing in php
<br />
<b>Notice</b>:  Undefined index: expire in <b>C:\xampp\htdocs\GoogleNexusWebsiteMenu\name.php</b> on line <b>4</b><br />
{"success":false}
