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.
我向表 sfGuardUser 添加了新字段 - is_online。如果用户登录我的网站,那么我将此字段设置为 TRUE。如果他注销然后我设置 FALSE,但是如果这些用户的生命周期过期如何设置 FALSE?
我认为最好在您设置上次活动日期的 sf_guard_user 表上创建一个字段。每次用户重新加载页面时,您都必须使用 current_timestamp 设置此日期。
现在您可以使用 date_diff 检查用户登录状态!