MX_Sitestats 1.31 Sessions going up all the time
 
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_sitestats
View previous topic :: View next topic  
Author Message
djjonde
Apprentice
Apprentice


Joined: 19 Jun 2004
Posts: 9

PostPosted: Fri Feb 25, 2005 1:26 am    Post subject: MX_Sitestats 1.31 Sessions going up all the time Reply with quote

Hi,

I installed your sitestats module to my test portal. Have I understood something wrong because both pages and sessions are growing each page load. Sometimes if I logout and clear cookies and IE's cache and start it over it doesn't do this. session stays at 1 but then again if I restart my browser and start crawling the site it always adds 1 to sessions and pages both every page load. Weird.

Have anyone seen this kind of weirdness before? I try to put my testboard available to net tomorrow.

Using MX-System 2.7.3 & PhpBB 2.0.12
mySQL server: 4.1.18
PHP 4.3.10
Apache 2.0
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Fri Feb 25, 2005 3:19 am    Post subject: Re: MX_Sitestats 1.31 Sessions going up all the time Reply with quote

The mx_sitestats session counter is based on PHP sessions. If PHP sessions fail, the session counter does not work correctly and incrementes the session counter for each page hit.

This is how it should work (when everything is set properly): The counter code increments the session counter and uses PHP session variables to mark the session as "known". So, the next hit for that session, that variable exists and the counter is not incremented again for that session.

PHP needs a session identifier to track sessions. The bad news are the PHP session identifier should be passed to the server on each client request, either via cookies or via GET/POST variables. The good news are PHP deals with all this stuff automatically (it is transparent to the programmer). If for whatever reason the PHP session identifier is not sucessfully stored on cookies or not passed via GET/POST request, PHP can't find the "old" session information, thinks this is a new session and creates a new session identifier along with a new pool to store session variables, etc. ...therefore, mx_sitestats counter code can't find the information about the previous hit for that session and increments the session counter (again).

By default PHP saves session variables on files located in the directory defined by the session.save_path setting.

If you're testing your site on your local machine, try to remove all files from the session path and perform several requests with your browser. Does that create a new session file for every request? If so, well, that means PHP is loosing track of your sessions for some reason.

Try to set correct values for session settings related to cookies, etc. You can test these PHP settings by using statements in the .htaccess file located in your portal root directory. The syntax is:

Code:
php_value   variable   "value"
php_flag    variable   off/on


Here's the page of the PHP manual related to session settings:
http://www.php.net/manual/en/ref.session.php

The most common cause for these problems are cookies, but who knows... anyway it will probably work on the new server. Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
djjonde
Apprentice
Apprentice


Joined: 19 Jun 2004
Posts: 9

PostPosted: Fri Feb 25, 2005 1:43 pm    Post subject: Re: MX_Sitestats 1.31 Sessions going up all the time Reply with quote

Thanks for lots of information!

markus wrote:

If you're testing your site on your local machine, try to remove all files from the session path and perform several requests with your browser. Does that create a new session file for every request? If so, well, that means PHP is loosing track of your sessions for some reason.


Hmm, Yes it does new file everytime i refresh. Can u try how does it work for you. Testportal available at link removed

Br,
DJ
 
Back to top
View user's profile Send private message
djjonde
Apprentice
Apprentice


Joined: 19 Jun 2004
Posts: 9

PostPosted: Fri Feb 25, 2005 1:52 pm    Post subject: Re: MX_Sitestats 1.31 Sessions going up all the time Reply with quote

Hmm. Yep, it got something to do with cookies, If I reset counters it works until I change browser or delete cookies. After that problems comes. Tried it and it worked on different server. Case closed.

Br,
Dj

PS. Could you edit my previous post and get rid of that URL. Wink
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Fri Feb 25, 2005 2:14 pm    Post subject: Re: MX_Sitestats 1.31 Sessions going up all the time Reply with quote

djjonde wrote:
Hmm. Yep, it got something to do with cookies, If I reset counters it works until I change browser or delete cookies. After that problems comes. Tried it and it worked on different server. Case closed.

It might be related to cookies and how the browser deals with them regarding domain name, security zones, etc.


djjonde wrote:
PS. Could you edit my previous post and get rid of that URL. Wink

Done! Rolling Eyes

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_sitestats All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum