PHP Zend Framework在注销时在所有浏览器中杀死会话

PHP Zend Framework在注销时在所有浏览器中杀死会话

问题描述:

I can login to my application using firefox and google chrome. When I click logout of google chrome, it goes back to the login screen. However, the user is still logged into firefox. How do I remove the sessions from both firefox and google chrome when I log a user out of one of the browsers.

Thanks!

我可以使用firefox和google chrome登录我的应用程序。 当我点击谷歌浏览器的注销时,它会返回到登录屏幕。 但是,用户仍然登录到Firefox。 当我将用户从其中一个浏览器中注销时,如何从firefox和google chrome中删除会话。 p>

谢谢! p> div>

One solution is to store each session_id with user_id in db table, for example:

table active_session
id: primary key
user_id: int 11
session_id: varchar(50)
login_time: timestamp

then if you want to terminate one session, you can search for user_id using session_id, then, delete all other sessions from the table.