[Seaside] Seaside sessions not being either unregistered or GCed

Philippe Marschall philippe.marschall at gmail.com
Tue Jul 7 06:51:50 UTC 2015

On Sat, Jul 4, 2015 at 5:29 PM, Mariano Martinez Peck
<marianopeck at gmail.com> wrote:
> On Sat, Jul 4, 2015 at 12:08 PM, Bob Arning <arning315 at comcast.net> wrote:
>> Yes, it is per cache. What you may be overlooking is this: the cache will
>> be reaped every 10 (whatever) accesses or stores. That doesn't mean there is
>> anything actually expired at that time, but the reap happens (doing nothing)
>> and the strategy's count is reset to zero. If something expires after this
>> reap, then it will take another 10 accesses (or whatever) before the
>> newly-expired goes away.
> Thanks Bob for the explanation. It makes sense now.
> So....the last piece on the puzzle that I don't understand now is how can I
> hook when my session is expired. I mean... MySessionSubclass  >>
> #unregisgtered will be called when reaped, not when expired. So...how can I
> hook when my session is expired (when it gives the timeout to the user
> saying session was expired)?   Not sure if I need that, but jut wondering ;)

If I understand you correctly, either:

WAHandlerTrackingStrategy >> noHandlerFoundForKey:in:context: ->
WApplication >> #handleExpired: -> WAResponseGenerator >>
#expiredRegistryKey. This is the preferred way, the only issue is that
you don't have access to the session.

Or the removalAction on the cache. I would advise against doing it
here. Keep in mind the session being #unregisgtered here may not the
be session of the currently active request because we do bulk reaping.


More information about the seaside mailing list