It would be helpful if you explained what you mean by "doesn't work". What results are you getting when you run it? Do you get syntax/compile errors? Does it print something other than what you are expecting?
Right-off-the-bat you are going to have a problem because you are testing the results of the session_destroy() function. This function ALWAYS returns TRUE, so there is no use in testing it.
But even so, I don't know how you would realize that the script is not working, it should always print "You have successfully logged out..."
What results are you seeing when you run the script?
-- Rich Rijnders
-- Irvine, CA US