cancel
Showing results for 
Search instead for 
Did you mean: 

Invalidate the session on having closed the window

agey
Champ in-the-making
Champ in-the-making
Hello all,

I have a question about sessions in Alfresco, to see if someone can help me.

I want that a user who has done login in Alfresco and then closes the window without before having done logout, the session is invalidated. I want to say, that the sessions are invalidated on having closed the window.

I have been looking in several forums for some solution for other applications and have seen that is possible to realize it with javascripts. Does someone know how to do it? How can I integrate new javascrips in Alfresco?

Thanks.
2 REPLIES 2

pmonks
Star Contributor
Star Contributor
This is quite difficult to do unfortunately, since there's no easy way in Javascript to detect when the browser window is being closed vs other events.  See (for example) http://bytes.com/forum/thread149054.html for more details.

If you do find a general purpose solution to this problem it shouldn't be too difficult to add it to the Alfresco Web Client.  It may require modifying some of the Web Client JSPs however, in order to add the custom event handler code.

Cheers,
Peter

agey
Champ in-the-making
Champ in-the-making
Ok, seems to be difficult enough to find a general solution to all the browsers. I thought that it would be easy to find a solution that works well.

Actually, I need to invalidate the session of a user who has closed the window without doing logout because the system does not allow that this user should return to do login until the session is invalidated (or the user does logout or overcomes timeout). I think that I am going to try to reduce the timeout to do it (now timeout is 15 minutes,  too much to wait to return to do login). But the problem is that there are several tenants enabled in our Alfresco but only I want to reduce the timeout in one of them, is it possible?

Thank you very much for your commentary.