picyka Posted August 11, 2022 Share Posted August 11, 2022 Good night, I was doing some tests here and I discovered a situation. When I start unittimer, if I close the browser tab directly, its session does not die. TestCase.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 12, 2022 Share Posted August 12, 2022 Hello, Session will be terminated later. How long does it take, did you check !? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 12, 2022 Share Posted August 12, 2022 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 12, 2022 Share Posted August 12, 2022 6 minutes ago, irigsoft said: 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 Here is a different case, the tab closes. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 12, 2022 Share Posted August 12, 2022 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; Quote Link to comment Share on other sites More sharing options...
irigsoft Posted August 12, 2022 Share Posted August 12, 2022 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 ;)) Quote Link to comment Share on other sites More sharing options...
picyka Posted August 12, 2022 Author Share Posted August 12, 2022 4 horas atrás, Sherzod disse: Olá A sessão será encerrada mais tarde. Quanto tempo leva, você checou!? Good Morning, I'm going to do a test in production, if I'm not mistaken I've seen cases with more than 5 hours Quote Link to comment Share on other sites More sharing options...
picyka Posted August 21, 2022 Author Share Posted August 21, 2022 Em 12/08/2022 às 6:51 am, picyka disse: Bom Dia, vou fazer um teste na produção, se não me engano, já vi casos com mais de 5 horas. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.