Jump to content

UniTimer


picyka

Recommended Posts

49 minutes ago, Sherzod said:

Hello,

Session will be terminated later.
How long does it take, did you check !?

Hello, I have the same problem, no matter how long (several hours), the session does not end. My solution to this is:

1. added a check (with a message to the user "Are you there") and closing the session after 30 seconds if there is no response

2. when the same user enters a new session, all other sessions with him are closed

Link to comment
Share on other sites

I close session on server side (on forum have topics with close session on client side)

 

procedure TUniForm1.DlgMsgCallBack1 (Sender: TComponent; Res: Integer);
begin
    UniMainModule.StillThereAsked := False;
end;//case

 

TUniForm1.UniTimer1Timer(Sender: TObject);

begin

Inc (UniMainModule.WaitForStillThere);

TryStrToInt (UniServerModule.MySettings.Values ['AskStillThereEveryMin'],WaitStill);
If (WaitStill > 0)
AND ((UniMainModule.WaitForStillThere) >= WaitStill*60)
AND (not UniMainModule.StillThereAsked)
then begin
      UniMainModule.WaitForStillThere := 0;
      UniMainModule.StillThereAsked := True;
      uniGUIDialogs.MessageDlg ('Are You still there ?',mtConfirmation, [mbOK], DlgMsgCallBack1);

end;

end;

Link to comment
Share on other sites

1 hour ago, Sherzod said:

Here is a different case, the tab closes.

@Sherzod, in this situation the problem is the same.

I have a limit on the number of users in my app. So, if a user closes the tab and then opens a new one, they can't log in before logging out of the previous session. To combat the problem, I try to close any open session, but closing the tab, closing the browser, losing internet and so on make the problem bigger if session is not closed on these events and the user can't login. My Session Expires time is 8 hours.

I currently have no other solution to this problem (but I like what I did ;))

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...