Giter Club home page Giter Club logo

Comments (6)

ArchismanKarmakar avatar ArchismanKarmakar commented on July 21, 2024

No description provided.

The disconnect event simply does not work the way you are asking for. That event will fire any time the user navigates to a new page or refreshes the current page. That's how socket.io connections work in the browser. A given connection belongs to a particular page and when a new page is loaded, the prior connection is disconnected and then a new connection is created. There is nothing you can do to change that - that's part of the browser architecture. So, the socket.io disconnect event is simply not the same thing as when your user logs out and can never be the same.

Instead, you need to have your own function that does a logout which the user can trigger by some action in the page. This can be either a socket.io message, an ajax call from your page or by navigating to the logout page. That's how a user can logout and it has nothing to do with the disconnect event.

Similarly, a connect event just means that a user (who may or may not already be logged in) has connected. The login state will be stored in either a cookie or in a server-side session (that is indexed by a cookie).

from ak-meet.

ArchismanKarmakar avatar ArchismanKarmakar commented on July 21, 2024

No description provided.

for me I don't no AJAX req so if do this I would rather clear the UID and re-authenticate to /home endpoint, here the /logout endpoint is not working because socket.io is blocking calling of multiple events, so easiest way is to onclick="location.href='/view'"; roomId="";

from ak-meet.

ArchismanKarmakar avatar ArchismanKarmakar commented on July 21, 2024

No description provided.
inside room.ejs

<div class="main__controls__block" onclick="location.href=('/view');"">
                <div class="main__controls__button" onclick="location.href=('/view');">
                   <a href="/view"><span class="leave_meeting" onclick="location.href=('/view');">Leave Meeting</span></a>
                </div>
             </div>

server.js
app.get('/view',(req,res) => { res.render('view'); roomId=""; userId="";})

from ak-meet.

ArchismanKarmakar avatar ArchismanKarmakar commented on July 21, 2024

No description provided.

should i create a PR now?

from ak-meet.

akshat0313 avatar akshat0313 commented on July 21, 2024

No description provided.

should i create a PR now?

Yes you can create a PR now

from ak-meet.

ArchismanKarmakar avatar ArchismanKarmakar commented on July 21, 2024

No description provided.

should i create a PR now?

Yes you can create a PR now

#11 sir please check now.

from ak-meet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.