[Seaside] expire sessions

Ron Teitelbaum Ron at USMedRec.com
Wed May 9 02:08:10 UTC 2007

Hi All,

I have some session objects that need to be cleaned up.  I was hoping that
expire would be sent to inactive sessions.  It looks like this might be
happening randomly during requests but I'm not sure.

I see that unregister: -> clearHandlers -> unregistered calls expire.  I
think while tracing it I saw a 10% random chance of sessions expiring this

Am I getting this right do sessions expire this way, triggered randomly by
additional requests?  

If so this works when a browser is closed, but could we also add expire to
the second to last line of: 

WARegistry >> handleKeyRequest: aRequest
	| key handler keyString |
	"Under some circumstances, HTTP fields are collections of values"
	key :=	[keyString := aRequest at: self handlerField.
			(keyString isKindOf: OrderedCollection) ifTrue:
[keyString := keyString first].
			WAExternalID fromString: keyString] on: Error do:
[:e | nil].
	handler := handlersByKey at: key ifAbsent: [nil].
	^ (handler notNil and: [handler isActive])
		ifTrue: [handler handleRequest: aRequest]
		ifFalse: [
			handler expire.  "EXPIRE THE SESSION Since it timed
			self handleExpiredRequest: aRequest]

This would allow me to clean up sessions that expire sooner when the browser
was left open.  

Thank you for your help!

Ron Teitelbaum

More information about the seaside mailing list