[Final] simple sessions mod

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

[Final] simple sessions mod

Post by smithy_dll » Sat Jul 06, 2002 11:17 am

Well, I hated how session pages doesn't seem update every page, which is annoying cause lots of times you go to a page, and it says your not at that page but another. So I was looking through the sessions code, and found out why. phpBB has the default set so sessions entries only updated every 60 seconds or so, to save on queries. Well here is a simple way to make it update more often.

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
			//
			// Only update session DB a minute or so after last update
			//
			if ( $current_time - $userdata['session_time'] > 60 )
			{
#
#-----[ REPLACE WITH ]------------------------------------------
#
			//
			// Only update session DB a minute or so after last update
			//
			if ( $current_time - $userdata['session_time'] > 10 )
			{
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
#EoM
This simple little code sets update to every ten seconds, but you could change it to 1 or even zero seconds, or you could increase it if you wanted to save on even more queries (and don't mind limiting the who is online functionality). You probably shouldn't set it to 5 minutes or above, because thats how long sessions last.

User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll » Sat Oct 08, 2005 11:15 am

Locked under this document. Details for reclaiming the thread are within.

Locked

Return to “[2.0.x] MODs in Development”