[Seaside] Sessions disappearing?

Avi Bryant avi@beta4.com
Thu, 23 May 2002 21:30:02 -0700 (PDT)


On Thu, 23 May 2002, Tim Rowledge wrote:

> After a while (couple of days or whatever) I notice that something
> is making some sessions go away.
>
> The symptom is that in IAApplication>handleRequest:response:url: the
> session temp is nil. Looks like the sessions dictionary has 'nil' stored
> at the relevant spot by this time. The code looks rather like somebody
> was expecting that such a session key would invoke the ifAbsent block
> and thus make a new session.

Sessions are by default stored in an LRUCache.  This is configurable using the
standard config page (another useful option is the SegmentCache, which
writes infrequently used sessions out to an ImageSegment).  If you want a
different policy, just write a new subclass of IACache.

That they end up as nil instead of just disappearing from the dictionary
is I guess a peculiarity of WeakAssociations... I'll have to look at that.
Yes, it is supposed to start a new session when that happens.

Thanks.

a