Vigilant Psyche Posted March 22, 2008 Share Posted March 22, 2008 OK I managed to fix the signing in bit but now im stuck with signing out. I link to this page which should unset the variable $_SESSION["CURRENT_USER"] the link back to the original page works but when i get back there and echo the variable it is still set... here's the code: <html> <?php $refresh=$_GET['ref']; echo("<meta http-equiv=\"refresh\" content=\"0;url=http://www.mysite.com\">"); unset($_SESSION["CURRENT_USER"]); ?> </html> Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted March 22, 2008 Share Posted March 22, 2008 Try to unset the session before you redirect. You could also use session_destroy() instead to destroy all sessions. Quote Link to comment Share on other sites More sharing options...
Goldeneye Posted March 22, 2008 Share Posted March 22, 2008 Try this <?php session_start(); session_destroy(); header('location: http://www.mysite.com'); ?> That should work, though I don't know what the $refresh variable is for. I'm guessing redirecting back to the referring url.. but anyways, that's a pretty easy way to 'sign out.' Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 22, 2008 Share Posted March 22, 2008 don't use session_destroy() its the equivalent of deleting all your cookies for a single server! Instead target the session u want <?php session_start(); $_SESSION['CURRENT_USER'] = ""; die(header("location: index.php")); ?> Quote Link to comment Share on other sites More sharing options...
Trium918 Posted March 22, 2008 Share Posted March 22, 2008 don't use session_destroy() its the equivalent of deleting all your cookies for a single server! Instead target the session u want <?php session_start(); $_SESSION['CURRENT_USER'] = ""; die(header("location: index.php")); ?> So what would this equal to? <?php $_SESSION[''] ?> Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 22, 2008 Share Posted March 22, 2008 it be invalid syntax because you can't have an empty array key 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.