[Fwd: [phplib] Garbage Collection/Sessions] From: Ing. Alejandro Vázquez C. (alex <email protected>)
Date: 10/02/00

attached mail follows:


Maurice Jumelet wrote:

> Why does this happen?
> the only reasson I could imagine that sessions would not be deleted is that
> the database query somehow times out, but
> from ct_sql (i quess you use sql containers):
> the function to delete expired sessions from the session table is:
>
> $this->db->query(sprintf("DELETE FROM %s WHERE changed < '%s' AND name =
> '%s'",
> $this->database_table,
> $sqldate,
> addslashes($name)))
>

I've found that date arithmetic in MySQL isn't as realiable as I would like. In
other applications I've been forced to do something like the following:

DELETE FROM %s WHERE UNIX_TIMESTAMP(changed) < UNIX_TIMESTAMP('%s') AND name =
'%s'

However, this code would break in other RDBMS different from MySQL.

-alexv

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>