php - Facebook destroy session on logout -


i doing site client , using facebook login.. when login , log out of facebook works fine. when login shortly after log out, automatically logs in previous person logged in. question how destroy (i assume session or cookies) storing info or need expire access token? either way wandering if had solution has worked them quick fix turning long problem because of this.

session_start(); session_unset(); $_session['fbid'] = null; $_session['fullname'] = null; $_session['email'] =  null; $_session['valid']  = null;  header("location: " ."http://www.muchogusto.net");  

from session_destroy() man page

in order kill session altogether, session id must unset. if cookie used propagate session id (default behavior), session cookie must deleted. setcookie() may used that.


edit

this use:

session_start(); session_destroy(); setcookie('phpsessid','',time()-864000,'/');    // persistent cookie setcookie('phpsessid','',0,'/');    // session cookie 

add code after that:

session_unset(); $_session['fbid'] = null; $_session['fullname'] = null; $_session['email'] =  null; $_session['valid']  = null; header('location: http://www.muchogusto.net');  

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -