Welcome Guest, Not a member yet? Register   Sign In
howto get user window status question
#1

[eluser]vile[/eluser]
can u help me out guys. im creating a simple chat..
im wondering how can i possibly know my chat mate window status (i.e. still open or close).
is there any way to know if the windows is still active..
any suggestion on how am i going to do this. thanks!
#2

[eluser]Nick Husher[/eluser]
You could use a Javascript ping script that sends a request at a particular url on your server every so often. The ping script sets a "last heard from" flag on the server and returns all the text messages between the current time and the previous "last heard from" date. This way you could send messages at people who aren't actually connected to the chat server.

It's impossible without hackery (or HTML5, or a Flash/Silverlight plugin) to "push" data from the server to a set of known clients. And because HTTP requests are mostly-atomic, it's difficult to set up a real time connection with a browser between a client and the server. So the best you're going to get is a "turn-based" simulation of that connection.
#3

[eluser]Suanko[/eluser]
I have about the same question about status/session :

I made a database both for my app user list (users table) and for the sessions (sessions table).

I don't want 2 people to connect both with the same login/password.

What happen if a user close the window without logout first? Next time he will connect, how can i avoid the system to reply "you're already connected"? Shall i check the session table for user_data->status in the login script?




Theme © iAndrew 2016 - Forum software by © MyBB