Jump to content

need help in logging users out of web site


crp

Recommended Posts

Have a page which is credentialed with htaccess. Amazingly, after all these years, this is no mechanism within htaccess to "logout" a credentialed user. After lots of (dispiriting, this subject is not one of the shining examples of nice people) searching, I came up with trying this:

<?php
session_start();
var_dump($_SESSION);
$a =& $_SESSION;
unset($_SESSION);
$a['x'] = 1; // $a refers to the original $_SESSION
$_SESSION['x'] = 2; // new unrelated array
session_write_close();
?>

as a page called "logout.php" with a link on the index page that had been used to credential the user.

 

page loads, but when I go back to the index page the page shows up without prompting for credentials.

 

This might be one of those times when people need to see the page. I'm loath to post the page but if you are feeling quite curious you can message me and I'll send you the link.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...