<?php include ("database.php"); unset($_SESSION['REGNO']); unset($_SESSION['UNIVCODE']); session_destroy(); if(isset($_SESSION['REGNO']) && $_SESSION['UNIVCODE']) { echo "loggedin"; } else { echo "logout"; }