Is this a proper way to destroy all session data in php?

后端 未结 9 607
耶瑟儿~
耶瑟儿~ 2020-11-27 18:21

Got it from php.net, but I am not sure is this how everybody destroy all sessions?

// Unset all Sessions
$_SESSION = array();

if (isset($_COOKIE[session_nam         


        
9条回答
  •  一个人的身影
    2020-11-27 18:36

    You will have to delete the session records.

    if session handled by DB - delete the rows.

    if session handled by FILES - delete the files.

    here you can find full example:

    http://mdb-blog.blogspot.co.il/2015/05/php-destroydelete-all-sessions.html

提交回复
热议问题