I have a piece of code that does the following:
if user logs on, the following code executes:
if (@$login) {
$query="select * from users where login_name='$login_name' and login_password='$login_password'";
$result=mysql_query($query);
if (mysql_num_rows($result)) {
@$userid=mysql_result($result,0,userid);
@$password = mysql_result($result,0,login_password);
@$user_id = mysql_result($result,0,login_name);
and then it sets a cookie. The page then refreshed $PHP_SELF and it reads the cookie and displays the username if logged on.
Now, when the user wants to log out, they click on a link that basically sets the cooke to a null value and then refreshed the page showing that the user is not logged on however the information from the above query is still available.
I have a field in the database stating the usertype and if that value is = "admin" then special menus are available. These menus are still available after the user logs out (deletes the cookie).
Question: How do I clear the query results after the user has logged out???