Hi,

I've read the issue on settings per role and understand this would be a bit troublesome.
Yet would it be possible to have different interval and age settings to clear anonymous sessions and authenticated sessions?

For instance Google, MSN and Baidu bots create loads of anonymous sessions on my site. So I would love to clear these and other anonymous sessions when they are older than 3 hours with an interval of 2 or so.

Yet my authenticated users can have the remember me option checked or have items in their shopping cart which I would like to keep for a longer period of time so they can continue shopping in a week or two for instance...

Would this be a feature you'd consider providing your module with?

Cheers,
Bartezz

Comments

bartezz’s picture

Status: Active » Needs review
StatusFileSize
new6.68 KB

Hi Khalid,

Things were crazy lately on my site. So many anonymous sessions that I was getting mysql out of memory errors in the logs!

I've taken a shot at #1 and have implemented the attached patch on my site without problems so far. I ran the code through coder and coder tough love modules and I was getting an alert on the line db_query("DELETE FROM {sessions} WHERE %s", $where); so maybe this needs improvement but I couldn't find a better way to do this without having to use multiple queries.

What do you think of this idea? It helped me solve the issue mentioned above where I want anonymous users to lose their session after let's say an hour but let authenticated users keep their session (with shopping carts, etc) for 2 weeks...

Cheers,
Bartezz

bartezz’s picture

StatusFileSize
new6.85 KB

Sorry, patch did not include my latest code... please review this patch!

Cheers

deekayen’s picture

Version: 6.x-1.0 » 7.x-1.x-dev
Issue summary: View changes
Status: Needs review » Patch (to be ported)

I think it's unlikely to get this into 6.x.