Jump to content
Larry Ullman's Book Forums

Chapter 4: Issues With Logout And Reset Password


Recommended Posts

Login works smoothly. $_SESSION['user_id'] is set (I've confirmed that by echoing this at the top of the page as a troubleshooting step). However, once logged in, selecting either logout or change password from the menu successfully re-directs to the correct URL (either logout.php or change_password.php), but (and this confuses me to no end) the content is the content for index.php. The content for logout.php doesn't display, in other words. In addition, after selecting logout, the user_id variable continues to print at the top of the page, which seems to indicate that the logout functions are not executing correctly. I also attempted to unset the $_SESSION['user_id'] before setting the $_SESSION to an empty array in logout.php, to no effect. The page title remains the default, not "Logout", so, even though the URL string is logout.php, the page is obviously still index.php.

No errors on the page, and the server error log shows nothing. Hope someone here has some ideas, because I'm out of them. 

Link to comment
Share on other sites

@Duke...no joy. I've confirmed my logout.php is identical to the downloadable example for the book. When I say content is displaying for index.php, I  mean that the logout message on logout.php isn't displaying. The URL is changing, but the page is not re-directing, and the user_id isn't being removed from the session. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...