1
I have a user control that stores in an Applitioscope a list of users logged in to the system. Together with each user, I save the session id that it is logged in. Each session lasts around 20 without the user messing with the system. I do not allow the same user with different session id to avoid conflict in operations. If I call the login screen and there is already a login id in the system, I automatically recover the user and redirect to the system home screen. If there is already a logged-in user with a different session id, a question is asked if you want to take down the other system session.
My problem is that when I close the browser, the session remains open on the system, and when I open the same browser again the session id is changed and identifies as if it already had another user logged in to the system. I wanted to when to close the browser log out of the system. I was using the remote onbeforeunload but it is triggered when I update the screen and when I call a new screen.
It would be possible to verify that there is no browser logged in with the session (Httpsession) that is in the Applitionscope list?
Or maybe check if the tab or browser is actually being closed and not updated?
Thanks for the tip... this control is already working well... solved my problem (of one person is emitting a nfe and the other opens the same nfe with the same user and the two try to transmit...) Being that I have also treated for two Viewscope in different tabs, to validate actions only from the last open view. Later I can think about mapping the actions yes. But if it wasn’t the detail of closing the browser and changing the session id when it reopens! The usability became very good, simple and safe for the user. Thanks for the answer...
– João Paulo