<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>Re: [Seaside] Autologout implementation</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>I think he wanted the app to go back to the home page automatically when auto expiring. In which case you can just add a refresh periodical with lifetime just a tad longer than a session timeout.<BR>
<BR>
Cheers!<BR>
<BR>
-Boris (via BlackBerry)<BR>
<BR>
----- Original Message -----<BR>
From: seaside-bounces@lists.squeakfoundation.org <seaside-bounces@lists.squeakfoundation.org><BR>
To: Seaside - general discussion <seaside@lists.squeakfoundation.org><BR>
Sent: Sun Apr 27 11:40:45 2008<BR>
Subject: Re: [Seaside] Autologout implementation<BR>
<BR>
2008/4/27, Stefan Schmiedl <s@xss.de>:<BR>
> How would you implement automatic logout after a given period of<BR>
> inactivity?<BR>
<BR>
Set the session timeout to this value.<BR>
<BR>
Cheers<BR>
Philippe<BR>
<BR>
> The app is running in a workshop, where a bunch of people use the same<BR>
> machine to access their scheduled tasks and other stuff. They will often<BR>
> leave "their" last page on the screen, so the goal donor requested an<BR>
> automated reload of the starting page.<BR>
><BR>
> I did this for another app (in IOWA on Ruby) by meta-refreshing to the<BR>
> "/logout" page, which in turn expired the session and redirected to the<BR>
> starting page.<BR>
><BR>
> Below is what I came up with in Seaside. This decoration is<BR>
> autmatically added to the pages if the users are in the autologout<BR>
> category.<BR>
><BR>
> Has anybody a better idea for this?<BR>
><BR>
> Thanks,<BR>
> s.<BR>
><BR>
><BR>
> Smalltalk.HS defineClass: #AutoLogoutDecoration<BR>
> superclass: #{Seaside.WADecoration}<BR>
> indexedType: #none<BR>
> private: false<BR>
> instanceVariableNames: 'delay '<BR>
> classInstanceVariableNames: ''<BR>
> imports: ''<BR>
> category: ''!<BR>
><BR>
> "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!<BR>
><BR>
><BR>
> !HS.AutoLogoutDecoration class methodsFor: 'instance creation'!<BR>
><BR>
> delay: seconds<BR>
><BR>
> ^(self new) delay: seconds;<BR>
> yourself! !<BR>
><BR>
> "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!<BR>
><BR>
><BR>
> !HS.AutoLogoutDecoration methodsFor: 'updating'!<BR>
><BR>
> updateRoot: root<BR>
><BR>
> root redirectTo: self urlForExpiry asString<BR>
> delay: self delay!<BR>
><BR>
> urlForExpiry<BR>
><BR>
> Continuation currentDo: [:cc | ^self session actionUrlForContinuation: cc].<BR>
> (self session) expire;<BR>
> redirect! !<BR>
><BR>
> !HS.AutoLogoutDecoration methodsFor: 'accessing'!<BR>
><BR>
> delay<BR>
> ^delay!<BR>
><BR>
> delay: anObject<BR>
> delay := anObject! !<BR>
> _______________________________________________<BR>
> seaside mailing list<BR>
> seaside@lists.squeakfoundation.org<BR>
> <A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
><BR>
_______________________________________________<BR>
seaside mailing list<BR>
seaside@lists.squeakfoundation.org<BR>
<A HREF="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR>
</FONT>
</P>
</BODY>
</HTML>