Colin Guthrie wrote:
> There are 84542 rows here. Is this a lot? Doesn't sound like much, but 
> who knows :)

At least, it's a lot more than what I have here :-)

> Or would something like:
> DELETE FROM session where authenticated=0 and last_visit < 
> (strftime('%s','now') - 24*60*60*7);
> do the job fine?

It really depends on your project's policy. The installations I manage
have all users authenticating, so the table doesn't grow much. OTOH, if
you run a public project, the table will probably grow quite quickly,
and purging it based on the last activity may be a good idea. I'd keep
the entries a bit longer, though.

You may also want to have a look at the session_attribute table, and
remove the entries corresponding to the rows you deleted in the session
table as well. You can probably do both in a single query.

> If so, is there not some built in purging that goes on? Or perhaps a 
> plugin to randomly do this every 100 requests or something?

That sounds like a useful plugin for certain installations.

-- Remy

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to