Skip to content
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

[FEAT]: Prevent opening in multiple tabs #7

Open
majorbruteforce opened this issue Dec 18, 2023 · 2 comments
Open

[FEAT]: Prevent opening in multiple tabs #7

majorbruteforce opened this issue Dec 18, 2023 · 2 comments

Comments

@majorbruteforce
Copy link
Member

A functionality can be built to prevent the app from being opened in multiple tabs like WhatsApp web does. This is to cater the limitation that SSE can have only 6 concurrent tabs open at a time and also reduce connections per user with the server.

@majorbruteforce majorbruteforce changed the title Feat: Prevent opening in multiple tabs [FEAT]: Prevent opening in multiple tabs Dec 25, 2023
@AnirudhParida
Copy link
Collaborator

Server-side solution: You can use a session-based mechanism on the server side, which will only allow one session per user. If the user tries to open the same site in another tab, the server will detect the existing session and redirect the user to the original tab.

JavaScript: You can use JavaScript to detect when a new tab is opened with the same URL and redirect the user back to the original tab.

@zakhaev26
Copy link
Contributor

zakhaev26 commented Dec 26, 2023

Nice techniques!
Client side JS would be better as it would respond fast , and UX will be good
Tracking Sessions in server might not be a scalable solution as it will store the session data in the RAM and would bloat the server mem if many clients use the app + It would take some time in the req<-->res cycle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants