overlordofevil Posted March 4, 2008 Share Posted March 4, 2008 I am trying to get a logout script to work. Basically a person clicks on this <a href="process.php?do=logout" target="_top">Logout</a> now what is suppose to happen is this link should call up the logout script (below) and return the user to the login screen. } if ($_GET['do']=="logout") { session_unset(); session_destroy(); if ($_COOKIE[user_id]) { setcookie("nero_id", ""); setcookie("nero_name", ""); setcookie("nero_pass", ""); setcookie("nero_rights", ""); } header("Location: index.php"); } What I get after all of this runs is just a blank screen so I am not sure what I missed. Any suggestions would be appreciated. Link to comment https://forums.phpfreaks.com/topic/94373-logging-out-and-clearing-sessions/ Share on other sites More sharing options...
revraz Posted March 4, 2008 Share Posted March 4, 2008 Sounds like you don't have error reporting turned on in your PHP.INI Do you have access to enable it? Link to comment https://forums.phpfreaks.com/topic/94373-logging-out-and-clearing-sessions/#findComment-483337 Share on other sites More sharing options...
overlordofevil Posted March 4, 2008 Author Share Posted March 4, 2008 well I am testing on a box here at the house before I upload to the webserver. I will check to make sure the error log is turned on in the PHP.INI, just curious what will that do for me ? Thanks for the suggestion. Link to comment https://forums.phpfreaks.com/topic/94373-logging-out-and-clearing-sessions/#findComment-483343 Share on other sites More sharing options...
deadonarrival Posted March 4, 2008 Share Posted March 4, 2008 stick this at the top of your screen error_reporting(E_ALL); Should make the errors come up for now. I'd guess it resets your sessions correctly, but can't send the header because it's already changed the session info (headers can't be sent twice) Stick echo "Logged out"; before the header tag, see if that comes up. Link to comment https://forums.phpfreaks.com/topic/94373-logging-out-and-clearing-sessions/#findComment-483356 Share on other sites More sharing options...
overlordofevil Posted March 5, 2008 Author Share Posted March 5, 2008 cool thanks for the advice... um the code works fine now, my server was locking up so I rebooted and everything works. Link to comment https://forums.phpfreaks.com/topic/94373-logging-out-and-clearing-sessions/#findComment-483410 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.