Page 1 of 1

The Logout object

Posted: Tue Jan 08, 2019 8:22 am
by alex4orly
I expect this object to terminate my login session
But, it seems it only redirects me to anotherpage, if the visitor hist the back button - he is still in the session?

Or is it not so?

Cheers

Re: The Logout object

Posted: Tue Jan 08, 2019 8:33 am
by Pablo
The logout object generates the following code:

Code: Select all

<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['form_name']) && $_POST['form_name'] == 'logoutform')
{
   if (session_id() == "")
   {
      session_start();
   }
   unset($_SESSION['username']);
   unset($_SESSION['fullname']);
}
?>
This will logout the user by unsetting the username.

Note that there is no redirect.