Jump to content

Logging Out???


dubt2nv

Recommended Posts

I am currently making a website using php for a project at tafe....and am wondering what php code i should use to allow the user to log out properly without the ability for people to return to the log-in pages by pressing back.....basically i have a log-in form that only allows users to log-in if the user has their details entered into the database....and i am jus wondering how i would make the log-out button actually log-out... ???
Link to comment
https://forums.phpfreaks.com/topic/26529-logging-out/
Share on other sites

if you're using cookies
whatever cookie is keeping the user logged in, set it empty:

[code]
setcookie("cookie_logged_in", "", time()+36000);
[/code]

if you're using sessions, which I hope you are, look up [url=http://www.php.net/session_destroy]session_destroy()[/url] and [url=http://www.php.net/session_unset]session_unset()[/url]
Link to comment
https://forums.phpfreaks.com/topic/26529-logging-out/#findComment-121395
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.