[Pugged] Logout x2?

Chris Van Cleve ciapug@ciapug.org
Tue, 29 Oct 2002 13:50:10 -0600


Hey gang,

I have a small form for use in logging in or out of a site. It's works beautifully, showing user anem and password fields if not logged in, queries the database whe the Login button is pressed and test against the values entered, shows a menu if logged in with content based on security level, and has a Logout button... It's the Logout button that's the problem. It works... the second time you press it. I am going to guess that the way I dump the user's session is my problem, but I'm a bit at a loss. I thought I'd tap this wonderful resource of guru's or any help that might be available. Here's my code:

The Logout Button itself:

      <form name="logout" action="<?= $PHP_SELF ?>" method="post">
        <input name="logout" type="submit" value="Logout">
      </form>

The test forthe Logout button being set:

	if(isset($_POST['logout'])) {
	session_destroy();
        }

I added the following line after the session_destroy(); line to see if it helped, but it didn't:

	header("Location: $rurl/index.php");

Any ideas? I know I'm flubbing something here...