sharal Posted September 19, 2009 Share Posted September 19, 2009 Hey guys, when the logout link is clicked, it logsout - but the sessions aren't destroyed. <?php session_destroy(); echo "<meta http-equiv='refresh' content='1;url=http://myurl/mysite/index.php'>"; ?> I've also tried with: session_start(); at the top, to unset the session by it's name / value. i've checked if the sessions still exists after i've logged out with session_start(); print_r($_SESSION); and they do. You might also need to know how it works when it logs in: $_SESSION['loggedin'] = 1; $_SESSION['username'] = "$username"; $_SESSION['password'] = "$shapw"; echo '<br />' ."logged in succesfully!"; // insert meta redirect echo "<meta http-equiv='refresh' content='2;url=http://mywebpage/mysite/profile/index.php'>"; } Hope you can help me with this. Link to comment https://forums.phpfreaks.com/topic/174795-solved-logout-system-not-working/ Share on other sites More sharing options...
ozestretch Posted September 19, 2009 Share Posted September 19, 2009 <?php session_start(); $_SESSION = array(); session_destroy(); echo "<meta http-equiv='refresh' content='1;url=http://myurl/mysite/index.php'>"; ?> Link to comment https://forums.phpfreaks.com/topic/174795-solved-logout-system-not-working/#findComment-921175 Share on other sites More sharing options...
sharal Posted September 19, 2009 Author Share Posted September 19, 2009 thanks for the quick reply, works now Link to comment https://forums.phpfreaks.com/topic/174795-solved-logout-system-not-working/#findComment-921176 Share on other sites More sharing options...
ozestretch Posted September 19, 2009 Share Posted September 19, 2009 thanks for the quick reply, works now welcome, remember to mark as 'solved' Link to comment https://forums.phpfreaks.com/topic/174795-solved-logout-system-not-working/#findComment-921180 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.