Jump to content

LOGOUT does not work


simonsays

Recommended Posts

I have a little problem with logout in my script.
There is a small piece of code responsible for that.
[code]if ((isset($_GET['logout'])) && ($_GET['logout']==1)) {
        session_unset();
session_destroy();
}[/code]
And there is a link in the logged user interface with 'logout=1' in its URL.However, when I click this link, the user interface seems to stay. And it is only gone when I click it the second time. What might be the problem?
Thank you in advance!
Link to comment
Share on other sites

when you run those commands, it does not go into effect until the next time you run a script.  it will still be in effect for the rest of the script.  kinda like making a cookie.  you can't access it until after you go to some new page.  when i do a logout, i usually redirect to a new page, like the main page or something.
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.