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...??? Link to comment https://forums.phpfreaks.com/topic/103035-sessions/ 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"); ?> Link to comment https://forums.phpfreaks.com/topic/103035-sessions/#findComment-527761 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 Link to comment https://forums.phpfreaks.com/topic/103035-sessions/#findComment-527765 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.