Is it possible to see active sessions using php?

匆匆过客 提交于 2019-12-13 04:31:46

问题


I am developing a php application. Is it possible to get active sessions and session values on my server? And is it possible to end up a particular session?


回答1:


If you want maximum flexibility with sessions you can save all your sessions in a database. Then it is very easy to get number of sessions, content of any session, kill them, etc...

http://shiflett.org/articles/storing-sessions-in-a-database

As a bonus you will increase the security!




回答2:


Currently in PHP you cannot get the active sessions directly. But, you can create your own session handler ( http://pt2.php.net/manual/en/function.session-set-save-handler.php ) and manage the session files.



来源:https://stackoverflow.com/questions/8587243/is-it-possible-to-see-active-sessions-using-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!