Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

[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

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
Member

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants