jmut wrote:Well, putting parse errors aside... I don't think $_SESSION can be accessed after you kill the session. Just put error_reporting(E_ALL) on top..and try it out. See if wanted behaviour.
It can. Well, sessions can't be accessed, but the variable '$_SESSION' can be set to an empty array, as can any other variable. It's just not actively tied to a session at that point.
Code: Select all
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();
That is good.
And yes, quote the whole index, $_SESSION['member_id'].
And as mentioned above, definitely call exit; after header(), although from what you posted, you're not sending any headers so it should be okay in that particular circumstance.