php session unset do not work sometimes -
i have code change session name:
session_name(md5('seg'.$_server['remote_addr'].$_server['http_user_agent']));
and logout:
session_name(md5('seg'.$_server['remote_addr'].$_server['http_user_agent'])); session_start(); $user = $_session["user"]; unset($_session['id']); unset($_session['user']); session_destroy();
the problem works, in first time. need click logout 3 times. may cause this?
try set whole session empty array:
session_start(); $_session = array(); session_destroy(); // $_session still accessible till page change.
Comments
Post a Comment