Do not delete persistent sessions in the purge script (#325)

This commit is contained in:
Clément Oudot 2011-06-09 14:26:51 +00:00
parent 5a216dcddc
commit bf2187c75b

View File

@ -97,15 +97,21 @@ for my $backend (@backends) {
my $entry = shift; my $entry = shift;
my $id = shift; my $id = shift;
my $time = time; my $time = time;
# Do net check sessions without _utime
return undef unless $entry->{_utime};
# Session expired # Session expired
if ( $time - $entry->{_utime} > $conf->{timeout} ) { if ( $time - $entry->{_utime} > $conf->{timeout} ) {
push @t, $id; push @t, $id;
} }
# User has no activity, so considere the session has expired # User has no activity, so considere the session has expired
elsif ( $conf->{timeoutActivity} and $entry->{_lastSeen} elsif ( $conf->{timeoutActivity}
and $entry->{_lastSeen}
and $time - $entry->{_lastSeen} > $conf->{timeoutActivity} ) and $time - $entry->{_lastSeen} > $conf->{timeoutActivity} )
{ {
push @t, $id push @t, $id;
} }
undef; undef;
} }