[PHP] Active PHP Sessions
Hi all, I'm on a shared server, and I do not believe that I have access to the /tmp directory where the session files are stored (I believe that is how it works :). I want to keep track of which sessions are active. Basically, I just want a list of the active sessions for my site. How can I do this? Thanks! _ Watch LIVE baseball games on your computer with MLB.TV, included with MSN Premium! http://join.msn.com/?page=features/mlbpgmarket=en-us/go/onm00200439ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Active PHP Sessions
I'm on a shared server, and I do not believe that I have access to the /tmp directory where the session files are stored (I believe that is how it works :). I want to keep track of which sessions are active. Basically, I just want a list of the active sessions for my site. How can I do this? Hi Are we talking about smb shares for linux. If so, why dont you just ask your admin to create a share to /tmp or create via php a web page that looks at /tmp and displayes the file. Remember, there are many ways to skin a cat. Copied and pasted from za.php.net ?php $dir = /tmp/; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { echo filename: $file : filetype: . filetype($dir . $file) . \n; } closedir($dh); } } ? Kind Regards Brent Clark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Active PHP Sessions
On Friday 07 May 2004 20:32, Paul Higgins wrote: I'm on a shared server, and I do not believe that I have access to the /tmp directory where the session files are stored (I believe that is how it works :). Of course you have access to it. The webserver needs to be able to READ the session files that it writes and hence you're also able to access those files with PHP. I want to keep track of which sessions are active. Basically, I just want a list of the active sessions for my site. You would have to define what /you/ mean by an active session. How can I do this? i) There is no way to determine which session files are for your site without actually examining their contents. ii) PHP does not store any site identification info in the session files. iii) Hence you need to store a (hopefully) unique string in all your sessions then search for this string in the session files. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Phasers locked on target, Captain. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Active PHP Sessions
From: Jason Wong [EMAIL PROTECTED] i) There is no way to determine which session files are for your site without actually examining their contents. ii) PHP does not store any site identification info in the session files. iii) Hence you need to store a (hopefully) unique string in all your sessions then search for this string in the session files. You have the option of using session_save_path() and using a directory of your own to store the session files. Then the active session count is just a count of how many files exist in that directory. You have to implement your own garbage cleanup of the session files, though. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Active PHP Sessions
An active session would be one that has not expired. Not necessarily that the user is not using the website. If the user leaves the site, the PHP session does not necessarily expire at that time. I want a list of PHP sessions that have not yet expired. Thanks! Paul From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] Active PHP Sessions Date: Fri, 7 May 2004 20:50:18 +0800 On Friday 07 May 2004 20:32, Paul Higgins wrote: I'm on a shared server, and I do not believe that I have access to the /tmp directory where the session files are stored (I believe that is how it works :). Of course you have access to it. The webserver needs to be able to READ the session files that it writes and hence you're also able to access those files with PHP. I want to keep track of which sessions are active. Basically, I just want a list of the active sessions for my site. You would have to define what /you/ mean by an active session. How can I do this? i) There is no way to determine which session files are for your site without actually examining their contents. ii) PHP does not store any site identification info in the session files. iii) Hence you need to store a (hopefully) unique string in all your sessions then search for this string in the session files. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Phasers locked on target, Captain. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php