[Seaside] Re: Looks like redirect creates a new session

Stephan Eggermont stephan at stack.nl
Thu Nov 19 08:54:44 UTC 2015


On 18-11-15 20:03, bsselfridge at gmail.com wrote:
> I looked at task and thought that it would only get me part of the way.
>
> Question: What happens if the user is sitting on a page for a long time and
> the session expires?

We try to avoid that. If you can afford to have long sessions:

QCComponent>>renderKeepAliveOn: canvas
	| cacheTimeout |
	cacheTimeout := self session application cache expiryPolicy 
configuration at: #cacheTimeout.
	canvas document addLoadScript:
		(canvas jQuery ajax
			callback: [];
			interval: (cacheTimeout - 60) seconds)

And then in the application

QCApplication>>renderContentOn: canvas
	self hasKeepAlive
		ifTrue: [ self renderKeepAliveOn: canvas ].
	self renderHeaderOn: canvas.
	super renderContentOn: canvas

Stephan



More information about the seaside mailing list