Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
0 registered (), 37 Guests and 15 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 12/20/03
Posts: 4420
Top Posters (30 Days)
Ruben 49
Gizmo 24
DennyP 24
Dunny 17
SteveS 14
AllenAyres 12
dbremer 10
SD 9
drkknght00 9
driv 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Topic Options
#167791 - 11/05/06 10:12 AM [NOTABUG] Session files get not cleared
Philipp Offline
journeyman
Registered: 07/30/06
Posts: 82
I just noticed that my sessions directory was full with hundred-thousands of session files . It was even not possible to clean the directory with rm *. Luckily midnight commander did the trick.

You might want to add a function to delete the session files after the session timed out


Edited by Rick (11/09/06 04:14 PM)
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#167792 - 11/05/06 11:26 AM Re: Session files get not cleared [Re: Philipp]
Flyin V Offline

member
Registered: 06/05/06
Posts: 118
I don't have that many session files in my session folder?
And all of mine are dated today so old ones here are going away.

Something odd to look into.
Top
#167799 - 11/05/06 03:08 PM Re: Session files get not cleared [Re: Flyin V]
Philipp Offline
journeyman
Registered: 07/30/06
Posts: 82
Interesting. If it helps the server is running the lastest PHP version (currently 5.2.0, 5.1.6 before) as FastCGI under LightTPD

The directory is still filling up with sessions:

Code:
bouncer:/var/webs/philipp# cd sessions
bouncer:/var/webs/philipp/sessions# find . | wc -l
3605
bouncer:/var/webs/philipp/sessions#

Top
#167801 - 11/05/06 04:15 PM Re: Session files get not cleared [Re: Philipp]
jgeoff Offline
Pooh-Bah
Registered: 08/08/06
Posts: 1922
Loc: NJ
All mine are from today, too -- in fact, only from the past 20 minutes or so...
_________________________
GangsterBB.NET (Ver. 7.5.6)
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Browsers: Chrome, Firefox, & Safari (Win7 and iPhone); No IE, ever!
Top
#167807 - 11/05/06 06:16 PM Re: Session files get not cleared [Re: jgeoff]
Gizmo Offline

Registered: 06/05/06
Posts: 14994
Loc: Portland, OR; USA
Mine are also all created today, couple hundred of them...

i'm pretty sure they get purged automagically when the session no longer exists.
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime UBB Supporter, UBB Beta Tester & Resident Post-A-Holic.
UBB Modifications, Styling, Coding Services, Disaster Recovery, and more!
Top
#167809 - 11/05/06 07:48 PM Re: Session files get not cleared [Re: Gizmo]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
This is handled natively by PHP, at least it's supposed to be. There is a setting in php.ini that designates how stale they need to be before they are cleared. Not back at home yet, so I can't actually check on the exact setting.
Top
#167817 - 11/06/06 01:33 AM Re: Session files get not cleared [Re: Rick]
Philipp Offline
journeyman
Registered: 07/30/06
Posts: 82
Thanks, I found the problem. It is related to the Debian PHP5 package, which handle session garbage collection different than other Linux distributions.

From the php.ini:

Code:
; This is disabled in the Debian packages, due to the strict permissions
; on /var/lib/php5.  Instead of setting this here, see the cronjob at
; /etc/cron.d/php5, which uses the session.gc_maxlifetime setting below
;session.gc_probability = 0
session.gc_divisor     = 100


I replaced:

Code:
;session.gc_probability = 0


with:

Code:
session.gc_probability = 1


and the sessions gets now automatically cleared
Top
#168158 - 11/12/06 08:14 AM Re: Session files get not cleared [Re: Philipp]
Gizmo Offline

Registered: 06/05/06
Posts: 14994
Loc: Portland, OR; USA
If your host allows you to, you can set these in a .htaccess file when you don't have access to edit the php.ini (although I'm unsure as to what level of permissions you'd need to override this setting)

.htaccess code:
Code:
session.gc_probability 1 1
session.gc_divisor 1000 1000


To check if this actually works wiht the security level they allow you (I use AllowOverride ALL in my php.ini for my sites so i can override settings as needed) you'll need to open a phpinfo script to check.

phpinfo.php:
Code:
<?php phpinfo(); ?>
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime UBB Supporter, UBB Beta Tester & Resident Post-A-Holic.
UBB Modifications, Styling, Coding Services, Disaster Recovery, and more!
Top



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Ability to "like" individual posts (not Facebook "likes)
by doug
09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Custom forum permissions
by ntdoc
05/18/12 02:07 PM
Forum Stats
10489 Members
36 Forums
33840 Topics
181693 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image