PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Check the PHP documentation for session_destroy(). A session has a few facets: the session data, the PHP Session, and the session id. Depending on how you want logouts to be handled, the best option to completely delete the session by setting the global array to array(), unsetting the session cookie to delete the session id, and then calling session_destroy().
Some bits about the posted snippet: "true" is not the same as true, i.e. all data from submissions (via URL or otherwise) are strings. Next, always always always quote your named array indices ($_SESSION[valid_user])