We have thought that when closing the window of login all the other windows 
were informed of the loss of session.

We have achieved this using native javascript $ window.onbeforeunload

At the time of closing the window erase the data of the localstorage of the 
session.

Then, using the localstorage event in all the open windows will trigger the 
change event in localstorage and thus learn that the session has actually 
been deleted.

The only problem is that reloading the login page also runs the $ 
window.onbeforeunload and this will delete the session and give the same 
behavior that we close the login page.

We are interested in not delete the session when refreshing the login page, 
just delete session when closing the page, is there any possibility to 
distinguish between both actions?

We could not find an event of the type: $ window.onbeforeunload that 
distinguishes between close page or reload page.

Any tool in the angular JS that you know and that can serve us?

Or maybe someone has another idea of how to make the other pages listen to 
what is done with the login page?

Thanks in advance for your help

El lunes, 31 de julio de 2017, 12:39:14 (UTC+2), Rafa escribió:
>
> Thanks your answer Sander, I totally agree with your idea, the user must 
> be well informed at all times.
>
>
> El lunes, 31 de julio de 2017, 11:36:25 (UTC+2), Sander Elias escribió:
>>
>> Hi Rafa,
>>
>> I still would recommend localstorage.  However I a have my questions 
>> about this UX. If you do this, make sure you let the user know what 'tabs' 
>> he has open, and that those also will be closed/logged out.
>>
>> Regards
>> Sander
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to