RE: [PHP] Sessions Questions
| From: | Warren Vail | Date: | Mon, 28 Apr 2003 06:49:56 +0000 |
| Subject: | RE: [PHP] Sessions Questions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145473@lists.php.net to get a copy of this message | ||
Sure,
Sessions are stored as individual files (session id is the filename) by
default in a /tmp directory (actual location can be detected by running
phpinfo()). This is unless your site is using save handler functions
(installed by session_set_save_handler(), see the manual), since this is
your site, you would probably know if session handlers are being used, most
often this is done to use a database session table.
listing the directory should give you a list of sessions, and the
modification timestamp of the file should tell you which ones are most
current. The file will contain a single string of serialized data (see the
manual).
if it's in a database, the table usually consists of three elements, the
session_key, a timestamp column, and a single column containing a single
string of serialized data (just like the file).
I have used this to hunt down users triggering error conditions on my site
(user id was stored in the session data), and a quick phone call to discuss
what the user was trying to do often resulted in quick resolution to the
problems.
good luck,
Warren Vail
warren@vailtech.net
-----Original Message-----
From: Bob Irwin [mailto:bob@staff.pnc.com.au]
Sent: Sunday, April 27, 2003 11:33 PM
To: php-general@lists.php.net
Subject: [PHP] Sessions Questions
Hi Guys,
Is it possible to read the data of all active sessions? I'm playing around
with a chat room script and want to be able to get all the active sessions
and the values that have been set for them. Can anyone point me in the
direction of a function that can do this?
Best Regards
Bob Irwin
*** Email domains@pnc.com.au for speedy email response ***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php