PHP知道用户是否在页面上

I am developing a Ticker support client in PHP with CodeIgniter, and I want to know if a user already open a ticket to hide this ticket from the list.

I know there is the solution of change a flag in database when the ticket is opened, then use :

 $(window).unload(function() {
    $.ajax({async:false ..... 
    /* change flag in database */
 });

But, what if the user's navigator is forcing to close ? Do I need a CRON task running to reset these flags ? Do you have some feedback for a complete solution ? Thanks.

查看全部
weixin_33749242
weixin_33749242
2012/12/19 09:04
  • session
  • codeigniter
  • php
  • ajax
  • 点赞
  • 收藏
  • 回答
    私信

2个回复