Author Topic: How to notify visitor when an operator has no activity for more than "X" seconds  (Read 9537 times)

0 Members and 1 Guest are viewing this topic.

yaseer_jaffar

  • Sr. Member
  • ****
  • Posts: 25
I have found "Connection timeout for messaging window" in the Settings -> Performance. I have given 15 seconds in that field. But it is not working eventhough the operator "X" has no activity for more than few minutes. I want to notify the visitor that the operator "X" is away when the operator "X" has no activity for more than 15 seconds.

Please help me. Thanks in advance.
« Last Edit: June 08, 2015, 12:43:12 PM by yaseer_jaffar »

Dmitriy Simushev

  • Moderator
  • Native
  • *****
  • Posts: 345
The "Connection timeout for messaging window" means if there is no ping from operator more than specified number of seconds he is treated as left. Next, there is no ping if the operator has closed chat window, has real network problems and so on.

I don't know what do you mean by "no activity", but it seems that it has nothing with "connection timeout" feature. Also I believe you can create a plugin for the functionality you are talking about.

yaseer_jaffar

  • Sr. Member
  • ****
  • Posts: 25
Dmitriy Simushev, let us consider Skype. If we login Skype and went away. Then the Skype status will be changed as "away" after few minutes. So, that the others can identify that he is away.

In our Mibew application, if the operator opened chat window and chat with a visitor. In the meantime if the operator went away for more than "X" seconds or minutes, then we should notify the visitor that he is away. Do you need some more details.

Please help me on this.

Dmitriy Simushev

  • Moderator
  • Native
  • *****
  • Posts: 345
One more time. I believe such feature can be implemented as a plugin. As far as I know there is no ready-to-use plugin for this, so you have to either create it by yourself or hire someone.

yaseer_jaffar

  • Sr. Member
  • ****
  • Posts: 25
Ok, Thank you Dmitriy Simushev. I understand. One more information I need to know.


If I logged in as a operator 10 days before and forgot to logout. If I access it now, the operator getting logged in. That is, the session is not getting expired. Is there anyway to make session expired after "X" seconds?


Please help me. It will solve my problem.

Dmitriy Simushev

  • Moderator
  • Native
  • *****
  • Posts: 345
There are two things you should take a look at:

1. When you log into Mibew there is a check box "remember me". Make sure it's unchecked. In this case operator's session lifetime is determined by PHP session lifetime.

2. Alter PHP's settings to use custom session lifetime. Take a look at http://php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime for details.

yaseer_jaffar

  • Sr. Member
  • ****
  • Posts: 25
Thank you Dmitriy Simushev. I have unchecked the Remember check box in the login page and also, I have set the gc_maxlifetime as 120 seconds in the php.ini file. Then I restarted Apache. In Home page, Session getting expired after refreshing the page. But, if we are in the visitors page, the session is not getting expired on refreshing the page. I don't know why the session is not getting expired if we are in the Visitors page. Can you please help me?

Dmitriy Simushev

  • Moderator
  • Native
  • *****
  • Posts: 345
The session is not expired because there are periodical AJAX requests from "<Mibew base URL>/operator/users" (Visitors) page to the server.

yaseer_jaffar

  • Sr. Member
  • ****
  • Posts: 25
Thank you so much Dmitriy Simushev for your help.

I have fixed this issue by adding the following line in init.php file.

@ini_set('session.cookie_lifetime', 14400); //4 hours

Dmitriy Simushev

  • Moderator
  • Native
  • *****
  • Posts: 345
I've told you about this INI parameter in one of my previous comments. Moreover, I believe it should work fine if set in appropriate PHP's ini file. Patching the core is not the best idea but it's up to you.

yaseer_jaffar

  • Sr. Member
  • ****
  • Posts: 25
Yes Dmitriy Simushev, you have already given me the link. But, I am not sure which one to use. Now, I have used INI and fixed the issue with the help of you.

Thank you  :)