Autologout implementation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Autologout implementation

Stefan Schmiedl
How would you implement automatic logout after a given period of
inactivity?

The app is running in a workshop, where a bunch of people use the same
machine to access their scheduled tasks and other stuff. They will often
leave "their" last page on the screen, so the goal donor requested an
automated reload of the starting page.

I did this for another app (in IOWA on Ruby) by meta-refreshing to the
"/logout" page, which in turn expired the session and redirected to the
starting page.

Below is what I came up with in Seaside. This decoration is
autmatically added to the pages if the users are in the autologout
category.

Has anybody a better idea for this?

Thanks,
s.


Smalltalk.HS defineClass: #AutoLogoutDecoration
        superclass: #{Seaside.WADecoration}
        indexedType: #none
        private: false
        instanceVariableNames: 'delay '
        classInstanceVariableNames: ''
        imports: ''
        category: ''!

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!


!HS.AutoLogoutDecoration class methodsFor: 'instance creation'!

delay: seconds
       
        ^(self new) delay: seconds;
                yourself! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!


!HS.AutoLogoutDecoration methodsFor: 'updating'!

updateRoot: root
       
        root redirectTo: self urlForExpiry asString
                delay: self delay!

urlForExpiry
       
        Continuation currentDo: [:cc | ^self session actionUrlForContinuation: cc].
        (self session) expire;
                redirect! !

!HS.AutoLogoutDecoration methodsFor: 'accessing'!

delay
        ^delay!

delay: anObject
        delay := anObject! !
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Autologout implementation

Philippe Marschall
2008/4/27, Stefan Schmiedl <[hidden email]>:
> How would you implement automatic logout after a given period of
>  inactivity?

Set the session timeout to this value.

Cheers
Philippe

>  The app is running in a workshop, where a bunch of people use the same
>  machine to access their scheduled tasks and other stuff. They will often
>  leave "their" last page on the screen, so the goal donor requested an
>  automated reload of the starting page.
>
>  I did this for another app (in IOWA on Ruby) by meta-refreshing to the
>  "/logout" page, which in turn expired the session and redirected to the
>  starting page.
>
>  Below is what I came up with in Seaside. This decoration is
>  autmatically added to the pages if the users are in the autologout
>  category.
>
>  Has anybody a better idea for this?
>
>  Thanks,
>  s.
>
>
>  Smalltalk.HS defineClass: #AutoLogoutDecoration
>         superclass: #{Seaside.WADecoration}
>         indexedType: #none
>         private: false
>         instanceVariableNames: 'delay '
>         classInstanceVariableNames: ''
>         imports: ''
>         category: ''!
>
>  "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
>
>  !HS.AutoLogoutDecoration class methodsFor: 'instance creation'!
>
>  delay: seconds
>
>         ^(self new) delay: seconds;
>                 yourself! !
>
>  "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
>
>  !HS.AutoLogoutDecoration methodsFor: 'updating'!
>
>  updateRoot: root
>
>         root redirectTo: self urlForExpiry asString
>                 delay: self delay!
>
>  urlForExpiry
>
>         Continuation currentDo: [:cc | ^self session actionUrlForContinuation: cc].
>         (self session) expire;
>                 redirect! !
>
>  !HS.AutoLogoutDecoration methodsFor: 'accessing'!
>
>  delay
>         ^delay!
>
>  delay: anObject
>         delay := anObject! !
>  _______________________________________________
>  seaside mailing list
>  [hidden email]
>  http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Autologout implementation

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Stefan Schmiedl
Re: [Seaside] Autologout implementation

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.

Cheers!

-Boris (via BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: Seaside - general discussion <[hidden email]>
Sent: Sun Apr 27 11:40:45 2008
Subject: Re: [Seaside] Autologout implementation

2008/4/27, Stefan Schmiedl <[hidden email]>:
> How would you implement automatic logout after a given period of
>  inactivity?

Set the session timeout to this value.

Cheers
Philippe

>  The app is running in a workshop, where a bunch of people use the same
>  machine to access their scheduled tasks and other stuff. They will often
>  leave "their" last page on the screen, so the goal donor requested an
>  automated reload of the starting page.
>
>  I did this for another app (in IOWA on Ruby) by meta-refreshing to the
>  "/logout" page, which in turn expired the session and redirected to the
>  starting page.
>
>  Below is what I came up with in Seaside. This decoration is
>  autmatically added to the pages if the users are in the autologout
>  category.
>
>  Has anybody a better idea for this?
>
>  Thanks,
>  s.
>
>
>  Smalltalk.HS defineClass: #AutoLogoutDecoration
>         superclass: #{Seaside.WADecoration}
>         indexedType: #none
>         private: false
>         instanceVariableNames: 'delay '
>         classInstanceVariableNames: ''
>         imports: ''
>         category: ''!
>
>  "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
>
>  !HS.AutoLogoutDecoration class methodsFor: 'instance creation'!
>
>  delay: seconds
>
>         ^(self new) delay: seconds;
>                 yourself! !
>
>  "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
>
>
>  !HS.AutoLogoutDecoration methodsFor: 'updating'!
>
>  updateRoot: root
>
>         root redirectTo: self urlForExpiry asString
>                 delay: self delay!
>
>  urlForExpiry
>
>         Continuation currentDo: [:cc | ^self session actionUrlForContinuation: cc].
>         (self session) expire;
>                 redirect! !
>
>  !HS.AutoLogoutDecoration methodsFor: 'accessing'!
>
>  delay
>         ^delay!
>
>  delay: anObject
>         delay := anObject! !
>  _______________________________________________
>  seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Autologout implementation

Stefan Schmiedl
In reply to this post by Philippe Marschall
On Sun, 27 Apr 2008 20:40:45 +0200
"Philippe Marschall" <[hidden email]> wrote:

> 2008/4/27, Stefan Schmiedl <[hidden email]>:
> > How would you implement automatic logout after a given period of
> >  inactivity?
>
> Set the session timeout to this value.

Instead of manually expiring it, yes. This could happen after
authentication on a per-user basis.

But I still need the reload of the start page so that the machine
appears "free".

hmm... I need to try what happens when I set the session timeout to
120s and refresh after 125s.

Thanks,
s.

>
> Cheers
> Philippe
>
> >  The app is running in a workshop, where a bunch of people use the same
> >  machine to access their scheduled tasks and other stuff. They will often
> >  leave "their" last page on the screen, so the goal donor requested an
> >  automated reload of the starting page.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Autologout implementation

Stefan Schmiedl
In reply to this post by Boris Popov, DeepCove Labs (SNN)
On Sun, 27 Apr 2008 12:50:33 -0700
"Boris Popov" <[hidden email]> wrote:

> 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.

Ah. I see that I'm on the right track .-)

s.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Autologout implementation

cedreek
2008/4/27 Stefan Schmiedl <[hidden email]>:
> On Sun, 27 Apr 2008 12:50:33 -0700
>  "Boris Popov" <[hidden email]> wrote:
>
>  > 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.
>
>  Ah. I see that I'm on the right track .-)
>

Is subclassing WARedirectHandler a way to go here?

Cédrick

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside