Page 1 of 1

How Many Users Are On My Site Right Now?

Posted: Sat Sep 17, 2005 1:21 pm
by pando
Hello
I have read this tutorial:
viewtopic.php?t=29342

I used the SESSION way.
I opened a new folder to keep the session_id logs, and it worked OK, beside that big problem.
the logs don't get deleted after I leave the site.

Is it beacuse I have changed the directory where the logs kept in, now I need to do the deleting all by myself?
How it can be done?

Thank you.




the code:

Code: Select all

<?php
session_save_path("/forum/session");
session_start();


$sessionfiles = session_save_path()."/sess_*";
$sessionarray = glob($sessionfiles);
$sessioncount = count($sessionarray);
?>

Posted: Sat Sep 17, 2005 1:38 pm
by hawleyjr
I'd recommend using XHTML to determine this. I believe Burrito has a tutorial here detailing how to do it. It’s by far the most accurate way to determine how many users are on your site.

Posted: Sat Sep 17, 2005 1:43 pm
by pando
Well.. I'm new here.
I would ask Burrito excuse by I have no idea who the guy is. could you please give me a link to his tutorial?
Thanks.

Posted: Sat Sep 17, 2005 1:48 pm
by pando
found it
reading it
Thank you.

Posted: Sat Sep 17, 2005 1:56 pm
by feyd
the session system will run garbage collection at ~random intervals based on session.gc_probability and session.gc_divisor

http://php.net/session read the section on runtime configuration

Posted: Sat Sep 17, 2005 2:07 pm
by pando
no matter where the "garbage" is?

I have changed the path. would it still clean the garbage from the folder that in the new path?

3 people visited the page I'm working on
so I have 3 different session_id files in the new folder, they look like this one:
sess_417da72b6460593426590c583cfba71

time passes away... and they still there.

Posted: Sat Sep 17, 2005 2:11 pm
by feyd
if you had read how the two configuration values worked, you would know they determine when a garbage collection will happen cleaning up old session files...

Posted: Sat Sep 17, 2005 4:54 pm
by pando
"when" what about "where" ?
besides.. I have problem configure the lifetime of my SESSION, it seems that my server prevent me from changing the php configuration.

I don't have access to the php.ini on my server, so I tried use the .htaccess, I tried this line:

Code: Select all

php_value session.gc_maxlifetime "7200"
but it doesn't work.
so learning about the other 2 configuration might not be useful for me..

Posted: Sat Sep 17, 2005 6:31 pm
by Buddha443556

Posted: Sun Sep 18, 2005 2:22 am
by pando
Thanks
I will try it.