Forum for any topic of interest to the Qcodo community, including questions about the framework itself.
I want a simple log out link that will “destroy session” as they do in ruby on rails.
How do I do that? '
$_SESSION = array(); should do it.
also session_destroy(); could make the job depending if you want to destroy all the session or specific keys unset($_SESSION['key']) ; $_SESSION['key'] = null ;
hth
session_destroy() actually prevents you from using the session any more until session_start() is called again, so this is probably overkill and may cause issues.
session_destroy(); is better if you are actually 'logging out a user' for them not to return (until they come back, that is), unset($_SESSION['meow']); is better for single session values.