Jump to content

sessions logout.


brown2005

Recommended Posts

currently, my logout.php is

<?

session_start();

if(empty($_SESSION['MembersID']))
{
 
header("location: http://www.allinthissite.co.uk/index/index.php");

}

session_start();
session_unset();
session_unregister();
session_destroy();

header("location: http://www.allinthissite.co.uk/index/index.php");

?>

should i change this or is this ok, as it does logout, but i have seen other things in other logout.php's like exit;

and

session_unregister('wat ever here');


<?

session_start();

if(empty($_SESSION['MembersID']))
{
 
header("location: http://www.allinthissite.co.uk/index/index.php");

exit;

}
else
{
 
session_unset('MembersID');
session_unregister('MembersID');
session_destroy('MembersID');

header("location: http://www.allinthissite.co.uk/index/index.php");

exit;

}

?>

thats what i was thinking i should change to...
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.