[Seaside] setting 'expiry seconds' dynamically

Lukas Renggli renggli at iam.unibe.ch
Wed Sep 22 10:52:14 CEST 2004


Hi Lukas,

> I'm new to Seaside and currently building a web-interface to a 
> existing database application. Therefore I want the user to be able to 
> set the 'timeout' or 'expiry seconds'. how can I do that dynamically?

create a customized subclass of WASession and override the message 
#defaultTimeoutSeconds to return an i-var:

	MySession>>defaultTimeoutSeconds
		^self timeoutSeconds

Add an i-var 'timeoutSeconds' and write some accessor-methods:

	MySession>>timeoutSeconds
		^timeoutSeconds

	MySession>>timeoutSeconds: anInteger
		timeoutSeconds := anInteger

Now you are able to set the timeout on a per-session bases from any 
component:

	MyComponent>>foo
		...
		self session timeoutSeconds: 1234.
		...

Hope this helps,
Lukas

-- 
Lukas Renggli
netstyle.ch GmbH, Dählhölzliweg 18, CH-3005 Bern
Phone: +41 31 356 42 56 Fax: +41 31 356 42 57
http://www.netstyle.ch  mailto:info at netstyle.ch


More information about the Seaside mailing list