Sessions are not deleted when browser window closed by user

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kneejnick
Forum Newbie
Posts: 1
Joined: Fri Oct 31, 2003 9:56 am

Sessions are not deleted when browser window closed by user

Post by kneejnick »

Sessions are not deleted from /tmp when browser window closed by user.
GC does not pick them up, even though the probability is set to 100, and maxlife = 1

Any ideas?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

and session.gc_divisor?
did you check those values with

Code: Select all

<?php phpinfo(); ?>
or by looking into php.ini?
evilMind
Forum Contributor
Posts: 145
Joined: Fri Sep 19, 2003 10:09 am
Location: Earth

Post by evilMind »

I use cron to get rid of all the session files about every hour to pick up the files that php doesn't "collect".
If you open the dir (usually /tmp) and ereg (or preg) out the sess_* files you could then check the lifetime on each of the files, to see when they were last modified, and then delete(unlink) based off of that.
evilMind
Forum Contributor
Posts: 145
Joined: Fri Sep 19, 2003 10:09 am
Location: Earth

Post by evilMind »

Post Reply