phpMiX.org :: Open Source eXperiments

 
[MOD-DB] Update Session on Page Change MOD v1.0.0
Select messages from
# through # FAQ
[/[Print]\]
 
phpMiX.org -> Update Session on Page Change

#1: [MOD-DB] Update Session on Page Change MOD v1.0.0 Author: markus PostPosted: Wed Jun 08, 2005 5:26 am
    —
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note:
This MOD has been kindly approved by the phpBB MOD Team Smile

Check out its Release Announcement topic:
http://www.phpbb.com/phpBB/viewtopic.php?t=296737
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


MOD Title: Update Session on Page Change MOD

MOD Description: This MOD modifies the phpBB session management so it updates the user session information on page changes (so we get up to date info for viewonline).
Note: By default, session information is only updated after 60 seconds.

MOD Version: 1.0.0


Download:
http://www.phpmix.org/projects


How it works?

We could perhaps describe what this MOD does by using a bit of "pseudocode":

This would be standard phpBB behaviour when checking the user session:

IF session not updated in 60 seconds THEN
  1. Update session information in sessions table.
  2. Update session time and current page in users table.
  3. Delete expired sessions.
  4. Update session time in cookies.
ENDIF

Note the user session is updated only after 60 seconds of last update time. During this 60 seconds interval, the user might be jumping from page to page, from forum to forum, and this information gets simply lost.

This MOD solves this "situation" by adding a simple condition to the IF expression:

IF session not updated in 60 seconds OR user changed page THEN
  1. Update session information in sessions table.
  2. Update session time and current page in users table.
  3. Delete expired sessions.
  4. Update session time in cookies.
ENDIF

Therefore, we can get more accurate information when browsing the Who's Online report or the ACP Index page.

Quite simple, really.


MOD Header:

Code:
##############################################################
## MOD Title: Update Session on Page Change MOD
## MOD Author: markus_petrux < nospam@phpmix.com > (Markus) http://www.phpmix.com
## MOD Description: This MOD modifies the phpBB session management so it updates the user
##     session information on page changes (so we get up to date info for viewonline).
##     Note: By default, session information is only updated after 60 seconds.
## MOD Version: 1.0.0
##
## Installation Level: (Easy)
## Installation Time: 1 Minute
## Files To Edit: 1
##    includes/sessions.php
## Included Files: 0
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## - MOD related comments:
##   Tested with phpBB 2.0.15
##   This MOD is EasyMOD friendly.
##
##############################################################
## MOD History:
##
## 2005/01/31 - 1.0.0
## - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
 

#2: Re: [MOD-DB] Update Session on Page Change MOD v1.0.0 Author: markus PostPosted: Fri Jun 17, 2005 1:11 pm
    —
This MOD has been kindly approved by the phpBB MOD Team. Smile

Check out its Release Announcement topic:
http://www.phpbb.com/phpBB/viewtopic.php?t=296737

Download:
Please use the phpBB MODs Database (Add-On's category).

Support, feeback, suggestions:
Feel free to use this forum, here at phpMiX.
 

#3: Re: [MOD-DB] Update Session on Page Change MOD v1.0.0 Author: markus PostPosted: Fri Jun 17, 2005 9:00 pm
    —
Updated topic starter. Added the "How it works" section.


Hope that helps Wink
 




phpMiX.org -> Update Session on Page Change


output generated using printer-friendly topic mod. All times are GMT + 1 Hour

 
Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group