Universal logout in php

hi there i just wanna know how can i add a universal logout in php when user logs into his profile page,in profile page the logout works fine but if i want to go back to prev page like index or login page there should be a logout link just like facebook where user can go any where and get logout or make the user cant go back after hes logged in! happy to hear some tips thanks :slight_smile:

I guess it all depends on how you maintain the “logged in” status. If you do it via session variables, you’ll know which session variables need to be cleared to log the user out, and that’s what your logout button would clear, redirect to the same page which would then pick up on the fact that the session variables are not present, and show the “logged out” content rather than the “logged in” content.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.