Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道当浏览器关闭或计算机进入睡眠或休眠状态时是否可以强制注销用户会话?
有任何想法吗?
谢谢
直到计算机进入睡眠或休眠状态,这些操作才会发生在浏览器知识之外。您可以在浏览器关闭时通过检查基于 cookie 的用户身份验证来注销用户。在PHP和 Kohana 中,这是通过将 cookie expire参数设置为 0 来完成的。如果设置为 0 或省略,cookie 将在会话结束时(浏览器关闭时)过期。