AV1611 Posted April 26, 2008 Share Posted April 26, 2008 I'm confused by sessions... I know that to access a session variable the script needs to start with session_start then I can read out $_SESSION[var]. as I go from page to page, each script starts with the session_start and the session var is there.. now, I have a logout hyperlinl that simply does this: session_destroy(); header('Location: index.php'); when I click the link, it give me this error: Warning: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session in C:\xampplite\htdocs\cvlb\killall.php on line 2 Huh? Am I just very confused...??? Quote Link to comment Share on other sites More sharing options...
Gamic Posted April 26, 2008 Share Posted April 26, 2008 <?php session_start();//need to start the session before you destroy it session_destroy(); header("Location: index.php"); ?> Quote Link to comment Share on other sites More sharing options...
AV1611 Posted April 26, 2008 Author Share Posted April 26, 2008 LOLOLOLOL I just blew coffee on my monitor... sorry... I'm pathetic... thanks 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.