This is my code for logout.php
When I click LOGOUT on my webpage I’m building, I have to click it twice to logout, any idea why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First time you log out, the
ifis run through, destroying the session. Next time you log out, theelseis run through, removing the cookies.Look at PHP – session_destroy, there’s an example on how to handle this.
You can also do this in one run, just do two independent
ifs