when i logout it will directly redirect to login.php and also shows message "Logout".I want to do is,when i refresh that page ,that message should be disappear .i also tried session unset .Here is my code

Logout.php

<?php
session_start();

if(session_destroy()){

  //$_SESSION['msg'] = 'logged out';

 header('location:login.php?msg=loggedout!');


  }

?>

login.php

<?php

if ($_GET['msg'])

{
echo "Logout";
}
/if(isset($SESSION['msg'])) {
echo $
SESSION['msg'];
unset($_SESSION['msg']);
}
/

?>

    Don't use GET then! 😉

    I suppose you could set a cookie?

      Write a Reply...