I am doing this, because I am making a text file with a list of all
existing sessions.  Then another page checks to see if all of these are
still active and exist, and if not it will take action and remove the
session id from the list.  It goes along with the question I asked
earlier about the Flash chat program.  I figured that I would make a log
file of all sessions when a user logs in to chat, then if the user
doesn't log out properly (with the log out button) and just closes the
browser or shuts off the computer, then their id will be removed from
the list, since the session doesn't exist anymore.  If there is an
easier way to accomplish this, then please fill me in.  Here is the
Flash chat question I asked earlier with more details for you:

"Hey, I need some advice if anyone is willing to offer it.  I have a
chat program I am working on.  The interface is built in flash, and it
uses PHP also.  There is a main chat area where the users type their
messages back and forth, and there is also a smaller area which displays
all of the currently logged-in users.  When a user logs into the chat
room, it adds their nickname to a users.txt file, which creates a list
of all the online users and is then displayed in the chat page.  I also
have a logoff button that will search for the users nickname in the
users.txt file and remove it, so that it won't be displayed in the chat
window anymore.  The only problem I am having is that if a user doesn't
click on the logoff button and instead just closes the internet window
or shuts off their computer, then their nickname will still appear in
the list of users, since it wouldn't get a chance to be removed by the
logoff button.  I'm not sure how to accomplish this, I would appreciate
any help you can offer me.  Thanks a lot."

Thanks.

Matt 

-----Original Message-----
From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 09, 2003 9:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: working with sessions

Matt Palermo wrote:
>  
> My question is can I search the session folder for:
> cf4c4f6a8cffaf3334df48b6ea1d55e4 (or any other session id)  to see if
> that session still exists and is active, or if it is gone and doesn't
> exist anymore?  Can this be done?  Please let me know if you have any
> thoughts.

It can be done using the file series of functions.

The question is though, why? What passes that session id to you script 
and why do you need to check to see if the session is still valid or 
not? PHP automatically detects if a session is not longer valid ...

Can you explain more clearly why you want to do this? Maybe we can offer

a better way of achieving what you are *really* trying to do :)

Jean-Christian Imbeault



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to