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] Quote Link to comment 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] Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.