Jump to content

[SOLVED] one session variable not being destroyed


psychohagis

Recommended Posts

I have a system which uses three session variables;  'rank', 'username' and 'userid'.

I was doing the following on 'sign-out' to get rid of these variables:

 

$_SESSION = array();
session_destroy();

 

Which seemed to work as when I checked against uderid:

 

if (!isset($_SESSION['userid']) or $_SESSION['userid'] =='')
{
exit('You are not signed in!');
}

 

It told me I wasnt signed in.  I then wanted to do the following:

 

<?php


if ($_SESSION['rank']=='webmaster' OR $_SESSION['rank']=='chairman' OR $_SESSION['rank']=='secretary' OR $_SESSION['rank']=='treasurer')
{
?>

<br />
<div class="shinydiv">
<div class="title"> Admin</div>
<p>
<?php echo $_SESSION['rank'] ?>
</p>
</div>

<?php

}

?>

 

And for some reason it still appeared If I signed out.

 

I tried dumping all the session variables and the rank variable was the only one that showed up.

 

What's going wrong?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.