182x Posted November 17, 2006 Share Posted November 17, 2006 hey guys, I am deadling witha very old version of PHP and I have to use $HTTP_SESSION_VARS for my session variables and I have created a simple logout script which can be seen below however I am getting the error message: "Warning: Trying to destroy uninitialized session in /test/cgi-bin/file/logout.php on line 2"Any ideas where I have went wrong? Thanks.[code]<?phpsession_destroy();header("location:back.php")?>[/code] Link to comment https://forums.phpfreaks.com/topic/27593-logout-help/ Share on other sites More sharing options...
taith Posted November 17, 2006 Share Posted November 17, 2006 on some systems i've found... that session_destroy(); has no effect, try putting this... or perhaps just unset(); all of your main session variables...[code]<?@session_destroy();@session_end();header("location:back.php")?>[/code] Link to comment https://forums.phpfreaks.com/topic/27593-logout-help/#findComment-126183 Share on other sites More sharing options...
Orio Posted November 17, 2006 Share Posted November 17, 2006 You can also use-$_SESSION = array();which is faster.Orio. Link to comment https://forums.phpfreaks.com/topic/27593-logout-help/#findComment-126235 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.