Sep 08, 2008 | 10:12 AM  
Welcome

Don't have an account yet? You can create one, it is free, just click here

as a registered user you have some advantages like free downloads, comments and posting on our forums, depending upon this site's configuration and options.

 • •  Control Panel - Register - Login  • • 
Current Stable MDPro Lite 1.0821 Download
  Forum FAQForum FAQ   SearchSearch  UsergroupsUsergroups  PreferencesPreferences  Options forumOptions forum  Watched TopicsWatched Topics  Watched ForumsWatched Forums
Latest forum posts Latest forum posts  Log in to check your private messages Log in to check your private messages    Log inLog in 
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jag7720
MD user level 5
MD user level 5


Joined: July 28, 2006
Posts: 104
Location: U.S.A.
Member
Post  Posted: Mar 01, 2007 - 04:34 AM Reply with quote Back to top
Post subject: guest count

My guest count never seems to go down.

I always seem to have 30-50 guests. I hope this is true but I know it can't be. I require (free) registration to access my site and I can't fathom 30-50 people surfing my site and getting my standard "You must register to access this" message.

Why is the count always high and how can I get the guest count to display accurate info?


Jason
View user's profile Visit poster's website
dmcl1
MD Staff
MD Staff


Joined: June 11, 2004
Posts: 128
Location: U.S.A.
bannato
Post  Posted: Mar 01, 2007 - 05:00 AM Reply with quote Back to top

Jason,

I believe this has to do with users who have "timed out", but the system did not recognize this and remove them. There are two adjustments I make to the pnSession.php file for my sites based on comments I found when searching the forum.

Open includes/pnSession.php
At approx line 83, change the garbage collection setting, such as
Code:
    // Garbage collection
    ini_set('session.gc_probability', 100);      


And approx line 240, add two new lines of code to delete session variables (I'm including the existing line that they should be placed above for your reference)
Code:
// dmcl1 - next 2 lines added because user is not automatically logged out after timeout
      pnSessionDelVar('rememberme');
      pnSessionDelVar('uid');
        pnSessionNew($sessid, $ipaddr);


If you search the forum for "garbage collection", I think you will run across Pete's comments on this.
View user's profile
jag7720
MD user level 5
MD user level 5


Joined: July 28, 2006
Posts: 104
Location: U.S.A.
bannato
Post  Posted: Mar 01, 2007 - 05:13 AM Reply with quote Back to top

I found line 83 but when I search for pnSessionDelVar I only get a hit on line152

Here is the code around it

Code:

/**
 * Delete a session variable
 *
 * @param name $ name of the session variable to delete
 */
function pnSessionDelVar($name)
{
    $var = "PNSV$name";

    global $$var;
    // Fix for PHP >4.0.6 By John Barnett (johnpb)
    // unset($$var);
    unset($GLOBALS[$var]);

    session_unregister($var);

    return true;




and I only find the rememberme around 467

Code:

            $where = "WHERE $sessioninfocolumn[vars] NOT LIKE '%PNSVrememberme|%'
                      AND $sessioninfocolumn[lastused] < " . (time() - (pnConfigGetVar('secinactivemins') * 60
));
            break;
        case 'Medium':
            // Medium security - delete session info if session cookie has
            // expired or user decided not to remember
            // themself
            $where = "WHERE ($sessioninfocolumn[vars] NOT LIKE '%PNSVrememberme|%'
                      AND $sessioninfocolumn[lastused] < " . (time() - (pnConfigGetVar('secinactivemins') * 60



So where should I add the lines you recommended?


Thanks

Jason
View user's profile Visit poster's website
dmcl1
MD Staff
MD Staff


Joined: June 11, 2004
Posts: 128
Location: U.S.A.
bannato
Post  Posted: Mar 01, 2007 - 05:22 AM Reply with quote Back to top

pnSessionDelVar() is part of what you are adding. It doesn't exist in the current version. Look for pnSessionNew($sessid, $ipaddr). And put the delvar lines directly above it.
View user's profile
jag7720
MD user level 5
MD user level 5


Joined: July 28, 2006
Posts: 104
Location: U.S.A.
bannato
Post  Posted: Mar 16, 2007 - 07:26 AM Reply with quote Back to top

I added this code and it seemed to make the count go down for a while.... but now it is still hovering around 50

Is there anything else I can do?
View user's profile Visit poster's website
Display posts from previous:     
Jump to:  
All times are GMT + 13 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by MDForum 2.0.8© 2003-2007 MAXdev Team
Credits