-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window.open causes logout #17
Comments
Hi bluefangs, This is an intended behaviour because the backend can't see a difference between opening a new tab or refreshing the current one. For both scenarios, it sees it as a brand new session. What do you try to achieve by calling "window.open" ? If it's for routing purposes then I would suggest using routing package to avoid this issue (e.g. react router). Would it be possible for you? If the reasoning is different as a workaround I could implement a method that you could call before opening the window, something like persistNextSession() but it doesn't seem too clean. |
Hi tprzytula, I have an application that gives the user an option to open a canvas either on the existing tab or on the new tab. While opening something on the new tab, Iron router does not seem to have any methods for this behaviour. Which is why I use Thanks. |
Hi @bluefangs In the documentation, there is a section called "Best Practises". https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Best_practices If I understand correctly then logic like this: |
Apologies for a late turnaround. I tried the above approach but it doesn't seem to help in this case:
|
Hi,
I've tried this package for making sure the user session has been logged out when the tab is closed. The package seems to go one step further and logout the user even when the page is refreshed - which is ok for the most part. However, when I try to open a new tab with a certain url using
window.open('some_custom_url_within_the_app', '_blank')
ORwindow.open('some_custom_url_within_the_app', '_self')
- it forces the user to be logged out - which doesn't seem to be nice.What can be a workaround for this behaviour? Can there be a disable logout on page refresh as an option?
Thanks.
The text was updated successfully, but these errors were encountered: