Hi
How do I get rid of expired sessions in hunchentoot without deleting valid sessions ("reset-sessions" invalidates and destroys all sessions)?
When looking at the sessions returned by "do-sessions", it seems that expired sessions are only removed once a user tries to reuse the expired session. But what if the user never revisits the site, will his/her expired session remain in the session list? (Or remain at least until the next call to "reset-sessions", which will also delete active sessions). How do I identify expired sessions when traversing the sessions with "do-session", or do I have to manually keep track of this?
Thanks. Nico
On Thu, 30 Nov 2006 17:53:32 +0200, Nico de Jager ndj@hivsa.com wrote:
How do I get rid of expired sessions in hunchentoot without deleting valid sessions ("reset-sessions" invalidates and destroys all sessions)?
When looking at the sessions returned by "do-sessions", it seems that expired sessions are only removed once a user tries to reuse the expired session.
Nope. See below.
But what if the user never revisits the site, will his/her expired session remain in the session list? (Or remain at least until the next call to "reset-sessions", which will also delete active sessions). How do I identify expired sessions when traversing the sessions with "do-session", or do I have to manually keep track of this?
Look at *SESSION-GC-FREQUENCY* and SESSION-GC. Does that help? I had plans to export them but somehow haven't done that yet. Do others think this would make sense, at least for the first symbol?
Cheers, Edi.
On Thursday 30 November 2006 18:06, Edi Weitz wrote:
On Thu, 30 Nov 2006 17:53:32 +0200, Nico de Jager ndj@hivsa.com wrote:
How do I get rid of expired sessions in hunchentoot without deleting valid sessions ("reset-sessions" invalidates and destroys all sessions)?
When looking at the sessions returned by "do-sessions", it seems that expired sessions are only removed once a user tries to reuse the expired session.
Nope. See below.
Excellent. I could not determine this from the documentation.
But what if the user never revisits the site, will his/her expired session remain in the session list? (Or remain at least until the next call to "reset-sessions", which will also delete active sessions). How do I identify expired sessions when traversing the sessions with "do-session", or do I have to manually keep track of this?
Look at *SESSION-GC-FREQUENCY* and SESSION-GC. Does that help? I had plans to export them but somehow haven't done that yet. Do others think this would make sense, at least for the first symbol?
In my case I want to close the session's database connection when the session expires and I was worried that this would only happen as described in my previous post. Having these symbols will give finer control, though. If SESSION-GC is exported then one can also control this per time period. But the current behaviour is adequate for my needs.
Thanks a lot for your quick response. Nico
On Thu, 30 Nov 2006 19:14:21 +0200, Nico de Jager ndj@hivsa.com wrote:
In my case I want to close the session's database connection when the session expires and I was worried that this would only happen as described in my previous post.
Have you seen this?
On Thursday 30 November 2006 19:19, Edi Weitz wrote:
On Thu, 30 Nov 2006 19:14:21 +0200, Nico de Jager ndj@hivsa.com wrote:
In my case I want to close the session's database connection when the session expires and I was worried that this would only happen as described in my previous post.
Have you seen this?
Yes thanks. That is what I use to close the database connections. But I was unsure about when expired sessions are actually deleted. During my tests I didn't send *session-gc-frequency* (50) requests and it seemed to me like an expired session was only deleted when a user tried to reuse the expired session or when you called RESET-SESSIONS.
If you don't export *SESSION-GC-FREQUENCY* and/or SESSION-GC, maybe a short note about this can be added to your already excellent documentation?
On Thu, 30 Nov 2006 19:32:45 +0200, Nico de Jager ndj@hivsa.com wrote:
If you don't export *SESSION-GC-FREQUENCY* and/or SESSION-GC, maybe a short note about this can be added to your already excellent documentation?
I've exported and documented the relevant symbols in this new release.
Thanks for the suggestion, Edi.
On Friday 01 December 2006 10:27, Edi Weitz wrote:
On Thu, 30 Nov 2006 19:32:45 +0200, Nico de Jager ndj@hivsa.com wrote:
If you don't export *SESSION-GC-FREQUENCY* and/or SESSION-GC, maybe a short note about this can be added to your already excellent documentation?
I've exported and documented the relevant symbols in this new release.
I see there is a new predicate as well, SESSION-TOO-OLD-P. This can be helpfull when traversing session. Great work as usuall.
Best wishes. Nico