Print Thread
Hop To
Joined: Jul 2006
Posts: 116
Likes: 4
P
Member
Member
P Offline
Joined: Jul 2006
Posts: 116
Likes: 4
I just noticed that my sessions directory was full with hundred-thousands of session files shocked. 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

Last edited by Rick; 11/09/2006 5:14 PM.
Joined: Jun 2006
Posts: 106
member
member
Joined: Jun 2006
Posts: 106
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.

Joined: Jul 2006
Posts: 116
Likes: 4
P
Member
Member
P Offline
Joined: Jul 2006
Posts: 116
Likes: 4
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#

frown

Joined: Aug 2006
Posts: 1,649
Likes: 1
Pooh-Bah
Pooh-Bah
Joined: Aug 2006
Posts: 1,649
Likes: 1
All mine are from today, too -- in fact, only from the past 20 minutes or so...


GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Mine are also all created today, couple hundred of them...

i'm pretty sure they get purged automagically when the session no longer exists.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
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.

Joined: Jul 2006
Posts: 116
Likes: 4
P
Member
Member
P Offline
Joined: Jul 2006
Posts: 116
Likes: 4
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

Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
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(); ?>


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
0 members (), 925 guests, and 159 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)