Jump to content

Logout User not Working


dmhall0

Recommended Posts

For some reason my logout is not working properly.  I searched other forum posts and read some tutorials but I still have an issue.

 

Do this to create session:

$_SESSION['username'] = $row['username'];
setcookie('username', $row['username'], time() + (60 * 60 * 24 * 5));

 

Do this to log out the user

session_start();
session_unset();
$_SESSION = array();
setcookie(session_name(), '', time() - 3600);
session_destroy();
setcookie('username', '', time() - 3600);

 

Above all else I am trying to end the $_SESSION['username']

 

Thank you all

Link to comment
https://forums.phpfreaks.com/topic/256782-logout-user-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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